问题:无法通过校验
PS D:\taro> npm install -g yarn
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/yarn failed, reason: unable to verify the first certificate
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-04-01T08_59_31_833Z-debug.log
解决:需要设置
npm config set strict-ssl false
npm install -g yarn
然后又问题:
无法查看yarn版本
Set-ExecutionPolicy : 无法绑定参数“ExecutionPolicy”。无法将值“RemoteSigned:”转换为类型“Microsoft.PowerShell.
ExecutionPolicy”。错误:“无法将标识符名称 RemoteSigned: 与有效的枚举器名称相匹配。请指定以下枚举器名称之一,然后
重试:
Unrestricted, RemoteSigned, AllSigned, Restricted, Default, Bypass, Undefined”
所在位置 行:1 字符: 21
+ set-ExecutionPolicy RemoteSigned:
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-ExecutionPolicy],ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.SetExecutionPolicyComm
and
解决:
PS D:\taro> set-ExecutionPolicy RemoteSigned
PS D:\taro> get-ExecutionPolicy
RemoteSigned
PS D:\taro> Set-ExecutionPolicy -Scope CurrentUser
问题:
error An unexpected error occurred: "https://registry.yarnpkg.com/@tarojs%2fcli: unable to verify the first certificate".
解决:
2017年2月27日,npm不再支持自签名证书。npm install走的是https协议,需要通过数字证书来保证的
npm config set registry http://registry.npm.taobao.org/
npm config set registry http://registry.cnpmjs.org/
npm list --depth=0 -global
一大堆的问题,最后发现全局安装,还是用npm .