npm install 出现UNABLE_TO_VERIFY_LEAF_SIGNATURE的解决办法

本文介绍了如何临时禁用npm的strict-ssl选项以解决HTTPS证书问题。通过运行`npm config set strict-ssl false`可以关闭SSL验证,而在完成操作后,使用`npm config set strict-ssl true`可恢复默认设置,确保安全性。

关掉strict-ssl即可,
如下:npm config set strict-ssl false
用完之后恢复:
npm config set strict-ssl true

npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @hapi/hoek@8.5.1 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@hapi%2fhoek failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @hapi/joi@15.1.1 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@hapi%2fjoi failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @hapi/topo@3.1.6 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@hapi%2ftopo failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for postcss@7.0.39 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/postcss failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @intlify/core-base@9.14.5 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@intlify%2fcore-base failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for picocolors@0.2.1 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/picocolors failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @intlify/shared@9.14.5 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@intlify%2fshared failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @intlify/message-compiler@9.14.5 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@intlify%2fmessage-compiler failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @isaacs/cliui@8.0.2 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@isaacs%2fcliui failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for ansi-regex@6.2.2 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/ansi-regex failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for emoji-regex@9.2.2 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/emoji-regex failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for ansi-styles@6.2.3 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/ansi-styles failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for string-width@5.1.2 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/string-width failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for strip-ansi@7.1.2 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/strip-ansi failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for wrap-ansi@8.1.0 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/wrap-ansi failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @jridgewell/gen-mapping@0.3.13 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@jridgewell%2fgen-mapping failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @jridgewell/sourcemap-codec@1.5.5 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@jridgewell%2fsourcemap-codec failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @jridgewell/resolve-uri@3.1.2 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@jridgewell%2fresolve-uri failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @jridgewell/trace-mapping@0.3.31 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@jridgewell%2ftrace-mapping failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'system' npm warn old lockfile } npm warn old lockfile Could not fetch metadata for @jridgewell/remapping@2.3.5 FetchError: request to https://cmc.centralrepo.rnd.huawei.com/npm/@jridgewell%2fremapping failed, reason: unable to verify the first certificate npm warn old lockfile at ClientRequest.<anonymous> (C:\Users\x60102926\AppData\Local\nvm\v22.19.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14) npm warn old lockfile at ClientRequest.emit (node:events:519:28) npm warn old lockfile at emitErrorEvent (node:_http_client:105:11) npm warn old lockfile at _destroy (node:_http_client:898:9) npm warn old lockfile at onSocketNT (node:_http_client:918:5) npm warn old lockfile at process.processTicksAndRejections (node:internal/process/task_queues:91:21) { npm warn old lockfile code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', npm warn old lockfile type: 'syst
最新发布
12-12
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

qaakd

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

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

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

打赏作者

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

抵扣说明:

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

余额充值