vscode报错信息
cnpm : 无法加载文件 C:\Users\Lenovo\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。 有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Polici es。 所在位置 行:1 字符: 1 + cnpm install + ~~~~ + CategoryInfo : SecurityError: (😃 [],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
解决办法:
1、方法一:
ctrl+ shift + Y进入终端模式
切换运行模式为Git Bash,不用powershell运行。
2、方法二:
如果想要保留powershell运行,则按照如下步骤进行:
1、打开powershell(一定要用管理员身份运行)
2、在命令行输入:set-ExecutionPolicy RemoteSigned
3、输入y
,回车
4、再次输入cnpm install就可以运行了