cnpm : Could not load file E:\node\node_global\cnpm.ps1 because running scripts is prohibited on this system.

This problem is the error I reported when I created a new terminal in vccode to execute the command. It is because of the permission problem that the input command cannot be executed.

The error is as follows:

cnpm : 无法加载文件 E:\node\node_global\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Executio
n_Policies。
所在位置 行:1 字符: 1
+ cnpm install
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Please add a picture description
The solution is as follows:

I executed it directly in the vscode terminalset-ExecutionPolicy RemoteSignedThis command works just fine.

Guess you like

Origin blog.csdn.net/li22356/article/details/129298388