【发布时间】:2022-01-02 06:39:46
【问题描述】:
当一个纱线命令被执行时,它会给出一个安全错误作为未经授权的访问。
yarn : File %FILEPATH%\yarn.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn start
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
但可以使用如下所示的命令绕过它。
powershell -ExecutionPolicy Bypass -File '%FILEPATH%\yarn.ps1' yarn start
所有 npm 命令都工作正常,错误仅在执行 yarn 命令时发生。这些命令在 Windows 10 操作系统上运行。
有没有办法以常规方式执行纱线命令? (只执行命令 yarn start)
【问题讨论】:
标签: javascript windows yarnpkg