-
问题原因:PowerShell 默认可能限制脚本执行。
-
解决方法:
-
在 PowerShell 中运行以下命令,查看当前策略:
Get-ExecutionPolicy
-
如果结果是
Restricted,改为RemoteSigned:Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
-
按
Y确认更改。
-
VSCODE的终端无法执行npm命令
最新推荐文章于 2026-05-14 02:35:41 发布
问题原因:PowerShell 默认可能限制脚本执行。
解决方法:
在 PowerShell 中运行以下命令,查看当前策略:
Get-ExecutionPolicy
如果结果是 Restricted,改为 RemoteSigned:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
按 Y 确认更改。
2771
1251
5768

被折叠的 条评论
为什么被折叠?
