问题
PS D:\Code\MoonShadow> npm install
npm : 无法加载文件 D:\Env\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft
.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ npm install
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
解决办法
1.查看权限
get-ExecutionPolicy
显示为Restricted禁用状态
2.修改权限
set-executionpolicy remotesigned