我安装了 node v16.13.0、npm v8.1.0、java 版本 1.8.0_211,我还以为我也已经安装了 yarn,但是尝试使用 yarn 全局安装 expo-cli 时,遇到以下问题:
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,但是现在我已经完全无法获取它:
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