cnpm or yarn : Could not load file C:\Users\admin\AppData\Roaming\npm\yarn(cnpm).ps1 because running scripts is prohibited on this system. For more information, please refer to https:

cnpm or yarn : Could not load file C:\Users\admin\AppData\Roaming\npm\yarn(cnpm).ps1 because running scripts is prohibited on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

Modify the security policy of the computer to:

Step 1: Run Windows Powershell as Administrator

insert image description here
.

Step 2: Enter set-ExecutionPolicy RemoteSigned

.

Step 3: Enter y

insert image description here

.

If the query is changed successfully, you can enter: [ get-ExecutionPolicy ] Whether the output is: [ RemoteSigned ]

Generally, a new computer configuration or a new installation environment needs to be configured once. This needs to be configured only when commands other than npm such as cnpm and yarn are not available in the editor or the command line.

Guess you like

Origin blog.csdn.net/weixin_44461275/article/details/123485084