npm install -g @angular/cli
To create a new workspace and initial starter app
ng new my-app
- Navigate to the workspace folder, such as
my-app
. - Run the following command:
cd my-app
ng serve --open
cd my-app
ng serve –open
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
At this point I encountered an error.
ng : File C:\Users\…\AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Exec
ution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
- ng serve –open
- ~~
- CategoryInfo : SecurityError: (:) [], PSSecurityException
- FullyQualifiedErrorId : UnauthorizedAccess
Open powershell in administrative mode and run the following command:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted