การติดตั้ง Angular CLI 8

เว็บหลัก Angular https://angular.io/

ใช้ npm ในการติดตั้ง Angular CLI

> npm install -g @angular/cli

ดูเวอร์ชันของ Angular CLI

> ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.3.0
Node: 10.16.2
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.0
@angular-devkit/core         8.3.0
@angular-devkit/schematics   8.3.0
@schematics/angular          8.3.0
@schematics/update           0.803.0
rxjs                         6.4.0

แต่ถ้า Error แบบนี้

> ng version
ng : File C:\Users\jack\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file
C:\Users\jack\AppData\Roaming\npm\ng.ps1 is not digitally signed. You cannot run this script on the current
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ng version
+ ~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

ให้แก้ไขด้วย

> Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

การดู help

> ng help

Link