【问题标题】:npm died completely, ERR_TLS_CERT_ALTNAME_INVALID, Hostname/IP does not match certificate's altnames: Host: registry.npmjs.orgnpm 完全死机,ERR_TLS_CERT_ALTNAME_INVALID,主机名/IP 与证书的替代名称不匹配:主机:registry.npmjs.org
【发布时间】:2019-02-07 05:29:00
【问题描述】:

我在 Windows (Ubuntu 18) 上运行 bash,最近切换到 Yarn,但我需要再次使用 npm 来安装 truffle,发现我的 npm 已经死了。我尝试重新安装 node/npm,甚至重新安装 Ubuntu 本身,但一直收到同样的错误。

以下是错误日志。我现在完全迷路了......

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using npm@5.6.0
3 info using node@v8.11.4
4 verbose npm-session 6f42a40556042ae5
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall inbox@1.0.0
7 info lifecycle inbox@1.0.0~preinstall: inbox@1.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 silly fetchPackageMetaData error for truffle@^4.1.14 request to https://registry.npmjs.org/truffle failed, reason: Hostname/IP$15 silly fetchPackageMetaData error for truffle@^4.1.14 request to https://registry.npmjs.org/truffle failed, reason: Hostname/IP$16 silly saveTree inbox@1.0.0
17 verbose type system
18 verbose stack FetchError: request to https://registry.npmjs.org/truffle failed, reason: Hostname/IP doesn't match certificate'$18 verbose stack     at ClientRequest.req.on.err (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/no$18 verbose stack     at emitOne (events.js:116:13)
18 verbose stack     at ClientRequest.emit (events.js:211:7)
18 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:387:9)
18 verbose stack     at emitOne (events.js:116:13)
18 verbose stack     at TLSSocket.emit (events.js:211:7)
18 verbose stack     at emitErrorNT (internal/streams/destroy.js:64:8)
18 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
18 verbose stack     at process._tickCallback (internal/process/next_tick.js:180:9)
19 verbose cwd /mnt/c/Users/user06/Documents/bootcamp/capstone/truffle_test
20 verbose Linux 4.4.0-17134-Microsoft
21 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
22 verbose node v8.11.4
23 verbose npm  v5.6.0
24 error request to https://registry.npmjs.org/truffle failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: r$25 verbose exit [ 1, true ]

【问题讨论】:

标签: node.js npm npm-install


【解决方案1】:

涉及 DNS 错误配置的早期中断导致某些 ISP 缓存 npmjs.com 丢失,解决方法是使用第三方 DNS 提供商,例如 Cloudflare 或 Google,受影响的缓存应在接下来的 24 小时内清除.

https://status.npmjs.org/incidents/v22ffls5cd6h

【讨论】:

    猜你喜欢
    • 2021-07-07
    • 2012-12-25
    • 2020-12-19
    • 2020-10-03
    • 2018-11-05
    • 2017-07-23
    相关资源
    最近更新 更多