Win10 does not have the right to load scripts such as vue/gulp when using PowerShell (set-ExecutionPolicy RemoteSigned)

  • Problem Description:

win10 uses powershell to install vue-cli globally, and when running vue --version to view the version, it prompts vue: the file D:\nvm\nodejs\vue.ps1 cannot be loaded, because scripts are forbidden to run on this system.

 After searching for a long time, it is said that there is no authorization, and the ExecutionPolicy variable needs to be changed to RemoteSigned. 

  • Solution

1. Use get-ExecutionPolicy to get the variable value, if it is Restricted, perform 2 operations, otherwise, please find another way;

2. Execution: set-ExecutionPolicy RemoteSigned, if the computer knows what you want, it may be ok here, but...I report the following error, please continue to read

3. According to the prompt of the elder brother, enter: Set-ExecutionPolicy -Scope CurrentUser

Prompt to enter the parameter value, enter RemoteSigned again

Another prompt is given, enter Y again

Finally succeeded!

4. Type vue --version again, it's perfect

Guess you like

Origin blog.csdn.net/liuxin00020/article/details/106567270