知点IT

PowerShell:因为在此系统上禁止运行脚本,解决方法

space 49 0

特别声明:文章多为网络转载,资源使用一般不提供任何帮助,特殊资源除外,如有侵权请联系!

问题

做npm开发时,使用npm安装软件可能会遇到下面的问题:

原因

powershell-脚本运行权限政策,获取当前策略:Get-ExecutionPolicy,设置当前策略:Set-ExecutionPolicy Unrestricted

  • Restricted * ——默认的设置, 不允许任何script运行
  • AllSigned *——只能运行经过数字证书签名的script
  • RemoteSigned *——运行本地的script不需要数字签名,但是运行从网络上下载的script就必须要有数字签名
  • Unrestricted *——允许所有的script运行

解决方案

在Powershell中输入下面指令:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy AllSigned -Force

none

评论列表 (已有0条评论)

消灭零回复

发表评论 (已有0条评论)