gpt4 book ai didi

node.js - npm 安装不工作

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

我刚刚开始学习 Node.js,并且已经安装了 Node.js 和 npm 模块管理器。我创建了一个 package.json 文件,并从根目录尝试执行 npm install 命令,而不是创建 npm_modules 文件夹,它会抛出如下错误:

C:\Users\username\Desktop\nodetest>npm install
npm WARN package.json backbone-library@0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/mongoose
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/path
npm http GET https://registry.npmjs.org/path
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/mongoose
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/path
npm http GET https://registry.npmjs.org/mongoose
npm ERR! Error: connect ETIMEDOUT
npm ERR! at errnoException (net.js:863:11)
npm ERR! at Object.afterConnect [as oncomplete] (net.js:854:19)
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.7600
npm ERR! command "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\no
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\username\Desktop\nodetest
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! syscall connect
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\username\Desktop\nodetest\npm-debug.log
npm ERR! not ok code 0

我使用的是 Windows 7 操作系统。

有什么想法吗?

谢谢,斯里尼瓦斯

最佳答案

这可能会解决您的问题:

npm config set proxy proxy-url:port (http:\\proxy-name:port)

npm config set https-proxy proxy-url:port

关于node.js - npm 安装不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15540338/

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