Open the terminal in vscode and get an error when using the cnpm command:
error message prompt
cnpm : Could not load file C:\Users\l\AppData\Roaming\npm\cnpm.ps1 because running scripts is prohibited on this system
. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
Location Line: 1 Character: 1
- cnpm i jquery --save
-
+ CategoryInfo : SecurityError: (:) [],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
Solution
-
run powershell as administrator
-
input the command
set-ExecutionPolicy RemoteSigned
-
Enter A and press Enter
-
Enter the cnpm command again to run