npm : 无法加载文件 C:\NodeJS\npm.ps1,因为在此系统上禁止运行脚本 【解决办法】

错误显示

npm : 无法加载文件 C:\NodeJS\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlin k/?LinkID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符: 1

npm init

npm : 无法加载文件 C:\NodeJS\npm.ps1,因为在此系统上禁止运行脚本 【解决办法】

解决办法

第一步:执行如下命令查看权限

get-ExecutionPolicy

禁用状态

第二步:执行如下命令设置可用

set-executionpolicy remotesigned

依需求执行选项后就可以了。

  • All rights reserved.
  • No part of this website, including text and images, may be reproduced, modified, distributed, or transmitted in any form or by any means, without the prior written permission of the author.
  • Unauthorized commercial use is strictly prohibited.
  • Unauthorized personal use is strictly prohibited.