[Vue Difficulties]——vue: The file D:\Program Files\nodejs\node_global\vue.ps1 cannot be loaded because running scripts is prohibited on this system.

disease

vue : 无法加载文件 D:\Program Files\nodejs\node_global\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:
/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ vue create siriup-vue
+ ~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Screenshot of the problem
The above problems are mainly caused by the security policy of PowerShell. You only need to modify the execution policy.

prescription

  1. Run PowerShell as administrator.
    Step-by-step pictures
  2. View the current execution policy
    get-ExecutionPolicy
    
    The query result is Restricted, indicating that the status is forbidden.command input
  3. Execute the modification command to modify the policy
    set-ExecutionPolicy RemoteSigned
    
    Enter it in the confirmation box that appears Y.command input
  4. Check whether the current execution policy has been modified to RemoteSigned
    get-ExecutionPolicy
    
    insert image description here
  5. cured by medicine

Guess you like

Origin blog.csdn.net/Arpen1997/article/details/132113919