npm安装express 总提示connect ETIMEDOUT
发布于 10 年前 作者 fengzheng101 140009 次浏览 最后一次编辑是 8 年前

系统是win7 64位,顺利安装了最新版本的nodejs 的msi,从官网下载,当利用npm安装express是发生问题,不只是express,在命令行输入:npm install时 网上的解决方案有: 1,重新设置代理http://manjeshpv.com/: npm config set proxy http://192.168.1.1:8080(代理服务器:端口) npm config set https-proxy http://proxy-domain.com:8080 (代理服务器:端口) 2,选择http方式 npm config set registry=“http://registry.npmjs.org”//设置npm源地址 3,公司的网络可能需要验证http://www.cnblogs.com/chrischeng/archive/2013/03/22/2975235.html: set http_proxy_user=username set http_proxy_password=password 4,还有建议说将proxy set null

总之试了很多方法,还是不行,希望大家帮帮忙,难道公司网络和防火墙的问题?但是防火墙关了貌似也没有用。 这是log信息: 0 info it worked if it ends with ok 1 verbose cli [ ‘D:\nodejs\\node.exe’, 1 verbose cli ‘D:\nodejs\node_modules\npm\bin\npm-cli.js’, 1 verbose cli ‘install’ ] 2 info using npm@1.4.21 3 info using node@v0.10.30 4 verbose node symlink D:\nodejs\node.exe 5 error install Couldn’t read dependencies 6 error package.json ENOENT, open 'D:\nodejs\package.json’ 6 error package.json This is most likely not a problem with npm itself. 6 error package.json npm can’t find a package.json file in your current directory. 7 error System Windows_NT 6.1.7601 8 error command “D:\nodejs\\node.exe” “D:\nodejs\node_modules\npm\bin\npm-cli.js” "install" 9 error cwd D:\nodejs 10 error node -v v0.10.30 11 error npm -v 1.4.21 12 error path D:\nodejs\package.json 13 error code ENOPACKAGEJSON 14 error errno 34 15 verbose exit [ 34, true ]

9 回复

@nihgwu 谢谢你的回复,也就是更改为:npm install -g cnpm --registry=http://r.cnpmjs.org 但是没有任何变化,还是报刚才上面的错误

@fengzheng101cnpm install xxx 也报错?

@nihgwu 在输入命令:npm install -g cnpm --registry=http://r.cnpmjs.org就报错了,当然下面cnpm install也不行,找不到这个command

晕,你本地肯定设置了proxy,加一个–no-proxy参数吧

@suqian 谢谢,公司是设了代理,周一试一下

是代理的问题,同样发生过呵呵

请问问题解决了么?遇到同样的问题!

解决了么?同样的问题

回到顶部