skip to Main Content

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


  1. 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):

    Set-ExecutionPolicy Unrestricted
    

    The documentation is here.

    -Edit-

    Adding the -Scope Process flag is generally encouraged.

    Login or Signup to reply.
  2. run this command in terminal

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

    check the solution here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search