NPM runs with an error “because running scripts is prohibited on this system” solution

Time:2021-12-6

NPM runs with an error “because running scripts is prohibited on this system” solution

NPM: the file C: \ users \ pathliu \ software \ nodejs \ npm.ps1 cannot be loaded because running scripts is prohibited on this system. For more information, see about in HTTPS: / go. Microsoft. COM / fwlink /? LINKID = 135170_ Execu
tion_Policies。
Location line: 1 character: 1

  • npm run start
    • CategoryInfo : SecurityError: (:) [],PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

The solution is as follows:

1) Searchpowershell, and “run as administrator”

NPM runs with an error

2) Use commandset-ExecutionPolicy RemoteSigned, change the execution policy on the computer toRemoteSigned

NPM runs with an error

3) Verify that the change was successfulget-ExecutionPolicy

NPM runs with an error
that will do

Copyright notice: This article is Weixin_ 37861326 original article, follow CC 4.0 BY-SA Copyright agreement, please attach the original source link and this statement.
Link to this article:https://blog.csdn.net/weixin_37861326/article/details/104295379

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Tutorial on sending e-mail using net:: SMTP class in Ruby

Simple Mail Transfer Protocol(SMTP)SendE-mailAnd routing protocol processing between e-mail servers. RubyIt provides the connection of simple mail transfer protocol (SMTP) client of net:: SMTP class, and provides two new methods: new and start New takes two parameters: Server name defaults to localhost Port number defaults to 25 The start method takes these parameters: Server – […]