vue : 无法加载文件 C:\Users\xxx\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft

 Window11系统解决方法:

 通过powershell去解除Execution_Policies(运行策略)的限制。

开始菜单或者小娜搜索输入powershell,powershell ISE或者直接powershell命令行都ok,选择 以管理员身份运行 。 

  1. 输入 get-ExecutionPolicy 查看当前策略,一般默认是:Restricted 受限制的
  2. 输入 set-ExecutionPolicy RemoteSigned 设置为RemoteSigned 远程签名
  3. 输入get-ExecutionPolicy -List 查看当前所有Scope的ExecutionPolicy
  4. 重新运行需要运行的vue ui脚本,选择允许防火墙。搞定!
  5. vue create vue3test

扩展阅读:PowerShell execution policies
Enforcement of these policies only occurs on Windows platforms. The PowerShell execution policies are as follows:

这些策略仅在Windows平台上执行。

PowerShell执行策略如下:

AllSigned:信任签名 Bypass:分流

Default:默认

那么windows系统默认的策略是:
Sets the default execution policy.

RemoteSigned:远程签证

Unrestricted:无限制

猜你喜欢

转载自blog.csdn.net/LlanyW/article/details/134891932