【问题标题】:Powershell cannot be loaded because running scripts is disabled on this system无法加载 Powershell,因为在此系统上禁用了运行脚本
【发布时间】:2021-10-27 03:46:54
【问题描述】:

我的问题与纱线有关。在我开始创建项目之前,我使用 npm 安装。 很长一段时间后,当我想开始使用纱线运行时,它说以下错误:

yarn : 文件 C:\Users\pc\AppData\Roaming\npm\yarn.ps1 无法加载,因为在此系统上禁用了运行脚本。

(在 Windows 机器,Powershell 中)

小鸟:10

我用 git bash 终端试过了!
但不在我的 powershell 终端中

【问题讨论】:

标签: windows powershell yarnpkg


【解决方案1】:

我刚刚自己修好了,反正我要在这里发布答案:

//打开windows命令以管理员身份运行shell并运行命令

  1. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

  2. Set-ExecutionPolicy 不受限制

【讨论】:

    猜你喜欢
    • 2017-04-28
    • 2020-03-06
    • 2021-02-22
    • 2020-06-20
    • 2013-05-03
    • 2019-12-31
    • 2018-06-08
    • 2013-10-06
    • 2019-10-05
    相关资源
    最近更新 更多