When I use a new computer for the first time to download installation packages such as vue , npm , and rimraf , I get the error
"File cannot be loaded. Running scripts is prohibited on this system."
Because the Restricted execution policy does not allow any scripts to run.
Solution:
- Win+r opens the command prompt and enter
powershell start-process powershell -verb runas
to run as administrator. - Enter
get-executionpolicy
to view the status as Restricted (indicating that it is restricted and the status is prohibited)
- Enter
set-executionpolicy remotesigned
and then enter Y.
The meaning of checking again is: locally created scripts can be run, and signed scripts authorized by trusted publishers can be executed, and that's it.
Finally, look at the execution results