无法在 windows 10 上安装纱线
Unable to install yarn on windows 10
我安装了 node v16.13.0、npm v8.1.0 java 1.8 版。0_211 我想我也安装了 yarn,但我试图使用 yarn global add expo-cli 安装 expo我得到:
yarn : File C:\Program Files\nodejs\yarn.ps1 cannot be loaded. The file C:\Program Files\nodejs\yarn.ps1 is not
digitally signed. You cannot run this script on the current system. For more information about running scripts and
setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn global add expo-cli
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
然后又尝试安装yarn,现在100%无法安装:
PS C:\Users\user> npm install -g yarn
changed 1 package, and audited 2 packages in 1s
found 0 vulnerabilities
但是 运行 yarn --version 我得到了和以前一样的错误:
yarn : File C:\Program Files\nodejs\yarn.ps1 cannot be loaded. The file C:\Program Files\nodejs\yarn.ps1 is not
digitally signed. You cannot run this script on the current system. For more information about running scripts and
setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn --version
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
执行:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
我安装了 node v16.13.0、npm v8.1.0 java 1.8 版。0_211 我想我也安装了 yarn,但我试图使用 yarn global add expo-cli 安装 expo我得到:
yarn : File C:\Program Files\nodejs\yarn.ps1 cannot be loaded. The file C:\Program Files\nodejs\yarn.ps1 is not
digitally signed. You cannot run this script on the current system. For more information about running scripts and
setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn global add expo-cli
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
然后又尝试安装yarn,现在100%无法安装:
PS C:\Users\user> npm install -g yarn
changed 1 package, and audited 2 packages in 1s
found 0 vulnerabilities
但是 运行 yarn --version 我得到了和以前一样的错误:
yarn : File C:\Program Files\nodejs\yarn.ps1 cannot be loaded. The file C:\Program Files\nodejs\yarn.ps1 is not
digitally signed. You cannot run this script on the current system. For more information about running scripts and
setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn --version
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
执行:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted