开发者
执行npm install报reason: self signed certificate in certificate chain错误解决方法
执行npm install报reason: self signed certificate in certificate chain错误解决方法
发表于2023/02/02
1010

【问题描述】

在执行npm install时报reason: self signed certificate in certificate chain,具体报错如下:

 

# npm install 

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN 

npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN 

npm ERR! request to https://registry.npmjs.org/lodash failed, reason: self signed certificate in certificate chain 

 

npm ERR! A complete log of this run can be found in: 

npm ERR!     /root/.npm/_logs/2023-02-02T07_16_54_625Z-debug.log 

[root@localhost xlsx2json-master]# 

[root@localhost xlsx2json-master]# 

[root@localhost xlsx2json-master]# npm install 

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN 

npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN 

npm ERR! request to https://registry.npmjs.org/glob failed, reason: self signed certificate in certificate chain 

cke_5966.png

【解决方法】

先执行npm set strict-ssl false取消npm的https认证,然后再执行npm install即可

注:npm install默认走的是https协议。

收藏举报
Level 1
0
帖子
0
粉丝
0
获赞