无法加载由 NPM 安装的应用程序(例如文件 C:\Users\name\AppData\Roaming\npm\ng.ps1),因为 运行 脚本在此系统上被禁用
Application installed by NPM (eg File C:\Users\name\AppData\Roaming\npm\ng.ps1) cannot be loaded because running scripts is disabled on this system
当 npm 安装 运行 命令(即 yarn、ng 等)时,我收到以下错误:
File C:\Users\<username>\AppData\Roaming\npm\<application> cannot be loaded because running scripts is disabled on this system.
其中 是 npm 安装的命令之一(即 yarn、ng 等)
如何解决这个问题?
我刚刚在 VS 终端 (PowerShell) 中尝试了这个命令,我的问题已经解决了
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
注意:不要将 CurrentUser 更改为您的用户名
edit :您可以按照此 link 将 visual studio 代码终端更改为 cmd.exe 而不是 PowerShell,无需任何安全问题。 https://blog.jongallant.com/2017/02/vs-code-integrated-terminal-powershell-default-change-to-cmd/
当 npm 安装 运行 命令(即 yarn、ng 等)时,我收到以下错误:
File C:\Users\<username>\AppData\Roaming\npm\<application> cannot be loaded because running scripts is disabled on this system.
其中
如何解决这个问题?
我刚刚在 VS 终端 (PowerShell) 中尝试了这个命令,我的问题已经解决了
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
注意:不要将 CurrentUser 更改为您的用户名
edit :您可以按照此 link 将 visual studio 代码终端更改为 cmd.exe 而不是 PowerShell,无需任何安全问题。 https://blog.jongallant.com/2017/02/vs-code-integrated-terminal-powershell-default-change-to-cmd/