When I faced this problem, by that time I have already tried triggering this command from Pwershell, both admin and non admin
Got this error:
''' ng: File C:\Users\vishi\AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1
Then I tried running from CMD as this issue was because of security policies applied on Powershell, then CMD showed this error:
'''The new command requires to be run outside of a project, but a project definition was found at C:\Users\vishi\ImprovApp\angular.json". '''
My question here is, if we are not part of admin group then we can not alter the PS security policy then is there any other way that we can run the nodejs Ng or npm commands????
After executing following command:
PowerShell says "execution of scripts is disabled on this system."
Security policy got updated, and then I triggered "ng serve --open" from VS terminal and then it worked.
details: Execute
Set-ExecutionPolicy RemoteSigned
undo
>Set-ExecutionPolicy Restricted
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.