I’ve tried to create vite@latest
in Visual Studio Code terminal plugin. Terminal says this error:
npm : File C:Program Filesnodejsnpm.ps1 cannot be loaded. The file C:Program Filesnodejsnpm.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
+ npm create vital@latest
+ ~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
2
Answers
PowerShell will not allow you to execute scripts at will. You can change that behavior by running this in an elevated terminal (run as admin):
The documentation is here.
-Edit-
Adding the
-Scope Process
flag is generally encouraged.run this command in terminal
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
check the solution here