gpt4 book ai didi

node.js - 快速安装错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:02:40 27 4
gpt4 key购买 nike

当我尝试通过 Node 安装 Express 时,它显示以下错误:

D:\NodeJS\express>npm install express
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express
npm ERR! Error: tunneling socket could not be established, cause=getaddrinfo ENOENT
npm ERR! at ClientRequest.onError (C:\Program Files\nodejs\node_modules\npm\node_modules\request\tunnel.js:161:17)
npm ERR! at ClientRequest.g (events.js:192:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:96:17)
npm ERR! at CleartextStream.socketErrorListener (http.js:1394:9)
npm ERR! at CleartextStream.EventEmitter.emit (events.js:96:17)
npm ERR! at Socket.onerror (tls.js:1318:17)
npm ERR! at Socket.EventEmitter.emit (events.js:126:20)
npm ERR! at Socket.connect.require.lookup.addressType (net.js:699:16)
npm ERR! at process.startup.processNextTick.process._tickCallback (node.js:244:9)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
npm ERR! cwd D:\NodeJS\express
npm ERR! node -v v0.8.17
npm ERR! npm -v 1.2.0
npm ERR! code ECONNRESET
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\NodeJS\express\npm-debug.log
npm ERR! not ok code 0

D:\NodeJS\express>

我也尝试过使用 -g 安装,但它不起作用!请帮帮我...

最佳答案

npm 似乎无法连接到中央存储库。这可能是因为您的笔记本电脑上存在一般连接问题,但您在此处做到了:) 或者可能是因为您计算机上的证书颁发机构与 npm 使用的证书之间不匹配。

确保您可以访问 https://registry.npmjs.org/express从您的浏览器没有任何证书(SSL 安全)警告。如果这不是原因,您应该更新您的证书颁发机构。

有一个针对 Windows 证书根的 Windows XP 更新。

关于node.js - 快速安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15498155/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com