npm安装失败

在这里插入图片描述
查看日志如下:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/node-v10.16.3-linux-x64/bin/node',
1 verbose cli   '/usr/local/node-v10.16.3-linux-x64/bin/npm',
1 verbose cli   'install' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose npm-session a05fa57cd2f64243
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall elasticsearch-head@0.0.0
7 info lifecycle elasticsearch-head@0.0.0~preinstall: elasticsearch-head@0.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 9ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 3ms
16 silly install loadAllDepsIntoIdealTree
17 silly fetchPackageMetaData error for grunt-contrib-concat@1.0.1 request to https://registry.npm.taobao.org/grunt-contrib-concat failed, reason: unable to verify the first certificate
18 silly fetchPackageMetaData error for grunt-contrib-connect@1.0.2 request to https://registry.npm.taobao.org/grunt-contrib-connect failed, reason: unable to verify the first certificate
19 silly fetchPackageMetaData error for grunt-contrib-watch@1.0.0 request to https://registry.npm.taobao.org/grunt-contrib-watch failed, reason: unable to verify the first certificate
20 silly fetchPackageMetaData error for grunt-contrib-copy@1.0.0 request to https://registry.npm.taobao.org/grunt-contrib-copy failed, reason: unable to verify the first certificate
21 silly fetchPackageMetaData error for grunt-contrib-jasmine@1.0.3 request to https://registry.npm.taobao.org/grunt-contrib-jasmine failed, reason: unable to verify the first certificate
22 silly fetchPackageMetaData error for karma@1.3.0 request to https://registry.npm.taobao.org/karma failed, reason: unable to verify the first certificate
23 silly fetchPackageMetaData error for grunt@1.0.1 request to https://registry.npm.taobao.org/grunt failed, reason: unable to verify the first certificate
24 silly fetchPackageMetaData error for grunt-karma@2.0.0 request to https://registry.npm.taobao.org/grunt-karma failed, reason: unable to verify the first certificate
25 silly fetchPackageMetaData error for grunt-contrib-clean@1.0.0 request to https://registry.npm.taobao.org/grunt-contrib-clean failed, reason: unable to verify the first certificate
26 silly fetchPackageMetaData error for http-proxy@1.16.x request to https://registry.npm.taobao.org/http-proxy failed, reason: unable to verify the first certificate
27 silly fetchPackageMetaData error for grunt-contrib-watch@1.0.0 request to https://registry.npm.taobao.org/grunt-contrib-watch failed, reason: unable to verify the first certificate
28 silly fetchPackageMetaData error for grunt@1.0.1 request to https://registry.npm.taobao.org/grunt failed, reason: unable to verify the first certificate
29 silly fetchPackageMetaData error for grunt-contrib-connect@1.0.2 request to https://registry.npm.taobao.org/grunt-contrib-connect failed, reason: unable to verify the first certificate
30 silly fetchPackageMetaData error for grunt-contrib-concat@1.0.1 request to https://registry.npm.taobao.org/grunt-contrib-concat failed, reason: unable to verify the first certificate
31 silly fetchPackageMetaData error for grunt-contrib-copy@1.0.0 request to https://registry.npm.taobao.org/grunt-contrib-copy failed, reason: unable to verify the first certificate
32 silly fetchPackageMetaData error for grunt-contrib-clean@1.0.0 request to https://registry.npm.taobao.org/grunt-contrib-clean failed, reason: unable to verify the first certificate
33 silly fetchPackageMetaData error for grunt-contrib-jasmine@1.0.3 request to https://registry.npm.taobao.org/grunt-contrib-jasmine failed, reason: unable to verify the first certificate
34 silly fetchPackageMetaData error for http-proxy@1.16.x request to https://registry.npm.taobao.org/http-proxy failed, reason: unable to verify the first certificate
35 silly fetchPackageMetaData error for grunt-karma@2.0.0 request to https://registry.npm.taobao.org/grunt-karma failed, reason: unable to verify the first certificate
36 silly fetchPackageMetaData error for karma@1.3.0 request to https://registry.npm.taobao.org/karma failed, reason: unable to verify the first certificate
37 timing stage:rollbackFailedOptional Completed in 0ms
38 timing stage:runTopLevelLifecycles Completed in 302ms
39 silly saveTree elasticsearch-head@0.0.0
40 verbose type system
41 verbose stack FetchError: request to https://registry.npm.taobao.org/grunt-contrib-watch failed, reason: unable to verify the first certificate
41 verbose stack     at ClientRequest.req.on.err (/usr/local/node-v10.16.3-linux-x64/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
41 verbose stack     at ClientRequest.emit (events.js:198:13)
41 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:392:9)
41 verbose stack     at TLSSocket.emit (events.js:198:13)
41 verbose stack     at emitErrorNT (internal/streams/destroy.js:91:8)
41 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
41 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
42 verbose cwd /usr/local/elasticsearch-head-master
43 verbose Linux 3.10.0-514.el7.x86_64
44 verbose argv "/usr/local/node-v10.16.3-linux-x64/bin/node" "/usr/local/node-v10.16.3-linux-x64/bin/npm" "install"
45 verbose node v10.16.3
46 verbose npm  v6.9.0
47 error code UNABLE_TO_VERIFY_LEAF_SIGNATURE
48 error errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
49 error request to https://registry.npm.taobao.org/grunt-contrib-watch failed, reason: unable to verify the first certificate
50 verbose exit [ 1, true ]

因为刚学习使用es,为了解决这个错误来来回回安装了三个多小时~~~
最后抱着试试的态度在度娘上面搜了一下这个问题:error code UNABLE_TO_VERIFY_LEAF_SIGNATURE 在linux任意路径下输入:
在这里插入图片描述

npm config set strict-ssl false

结果,还成功了,只想说一句mmp~~~
总结:可能是网络或者是防火墙问题造成的

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小郑要做干饭人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值