今天npm install总是报错:unable to verify the first certificate(无法验证第一证书),查了一下发现

As of February 27, 2014, npm no longer supports its self-signed certificates.

2014年2月27日,npm不再支持自签名证书。

因为npm install走的是https协议,需要通过数字证书来保证的

解决方法1:

取消ssl验证:npm config set strict-ssl false

如果还没成功,则将npm源更换为国内镜像:
npm config set registry http://registry.cnpmjs.org/
npm config set registry http://registry.npm.taobao.org/

解决方法2:

升级:npm install npm -g --ca=null
或者 npm config set ca=""

推荐使用方法1

相关文章:

  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-12-25
猜你喜欢
  • 2022-12-23
  • 2022-03-05
  • 2022-01-06
  • 2021-06-01
  • 2021-12-06
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案