CNode

如何通过代理使用npm install 安装

Yyuanalexwu发布于14 年前最后回复14 年前6 回复34082 浏览0 收藏

由于公司是通过代理上网的,导致直接使用npm install 安装无法安装 请问哪里可以设置代理 HTTP_PROXY已设置

----------------------报错信息----------------------------

C:\Documents and Settings\cpic>npm install socket.io

npm http GET https://registry.npmjs.org/socket.io

npm ERR! Error: failed to fetch from registry: socket.io

npm ERR! at C:\Program Files\nodejs\node_modules\npm\lib\utils\npm-registry- client\get.js:139:12

npm ERR! at cb (C:\Program Files\nodejs\node_modules\npm\lib\utils\npm-regis try-client\request.js:32:9)

npm ERR! at Request._callback (C:\Program Files\nodejs\node_modules\npm\lib
utils\npm-registry-client\request.js:137:18)

npm ERR! at Request.callback (C:\Program Files\nodejs\node_modules\npm\node_ modules\request\main.js:109:22)

npm ERR! at Request. (C:\Program Files\nodejs\node_modules\npm\no de_modules\request\main.js:198:58)

npm ERR! at Request.emit (events.js:88:20)

npm ERR! at ClientRequest. (C:\Program Files\nodejs\node_modules
npm\node_modules\request\main.js:195:10)

npm ERR! at ClientRequest.emit (events.js:67:17)

npm ERR! at CleartextStream. (http.js:1134:11)

npm ERR! at CleartextStream.emit (events.js:67:17)

npm ERR! 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!

npm ERR! System Windows_NT 5.1.2600

npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "socket.io"

npm ERR! cwd C:\Documents and Settings\cpic

npm ERR! node -v v0.6.10

npm ERR! npm -v 1.1.0-3

npm ERR! message failed to fetch from registry: socket.io

npm ERR!

npm ERR! Additional logging details can be found in:

npm ERR! C:\Documents and Settings\cpic\npm-debug.log

npm not ok

查看回复

回复 (6)

R
rabby#1·14 年前

我公司也是用proxy的 不需要额外设置吧 直接读环境变量的值 我直接可以用

J
jiyinyiyong#2·14 年前

难道要用 tsocks 和 proxychains 那类工具?

Y
yuest#3·14 年前

http://127.0.0.1:8118 npm install

可以用 privoxy 转换 socks5

socks5 是用 ssh 开启的

ssh 服务器是买的 ……

R
rabby#5·14 年前
引用 rabby我公司也是用proxy的 不需要额外设置吧 直接读环境变量的值 我直接可以用

没有 我用的linux 直接export的 才看到你这个是windows环境 我对windows的代理不太熟悉 好像要用isa来设?

W
windylcx#6·14 年前
参与回复
登录后即可参与回复。登录