Pycharm终端提示 Vue无法加载文件,因为在此系统上禁止运行脚本

当在终端执行vue -V,出现以下提示

vue : 无法加载文件 C:\Users\xxxx\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1

 

打开提示,阅读https:/go.microsoft.com/fwlink/?LinkID=135170 后得知是PowerShell 管理执行策略问题。

以管理员身份运行PowerShell:

执行命令Get-ExecutionPolicy -List 查看当前的策略;

如下:

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine    Undefined

更改策略执行:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

再执行命令Get-ExecutionPolicy -List 查看当前的策略

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine    RemoteSigned

表示更改成功,

现在在Pycharm终端中执行 vue -V就正常了

你可能感兴趣的:(python,vue)