[Solved] cnpm: Cannot load the file C:\Users\Raytine\AppData\Roaming\npm\cnpm.ps1 because running scripts is prohibited on this system

Solution:

1. Enter Windos PowerShell in the search box in the system

2. Click “Run as Administrator”

3. Enter “set-ExecutionPolicy RemoteSigned” and press Enter

4. According to the prompt, enter A and press Enter

5. Return to cnpm -v again to execute successfully.

Not only cnpm commands, including pnpm, yarn and other commands, if such an error is reported when executed, it can be solved by this method. The premise is that if you use the npm command to install these CLI command tools, they must be installed in the global environment to take effect.

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *