我试图运行在一个代理NPM。 我都试过直接输入代理或者Authoxy:
npm config set proxy http://localhost:8999
npm config set https-proxy http://localhost:8999
无论我使用的代理服务器,我总是以同样的错误运行时,最终npm search
:
npm info it worked if it ends with ok
npm verb cli [ 'node', '/usr/local/bin/npm', 'search' ]
npm info using npm@1.1.45
npm info using node@v0.8.4
npm verb config file /Users/xxx/.npmrc
npm verb config file /usr/local/etc/npmrc
npm verb config file /usr/local/lib/node_modules/npm/npmrc
npm WARN Building the local index for the first time, please be patient
npm verb url raw /-/all
npm verb url resolving [ 'https://registry.npmjs.org/', './-/all' ]
npm verb url resolved https://registry.npmjs.org/-/all
npm info retry registry request attempt 1 at 09:48:47
npm http GET https://registry.npmjs.org/-/all
npm info retry will retry, error on last attempt: Error: tunneling socket could not be established, sutatusCode=403
npm info retry registry request attempt 2 at 09:48:57
npm http GET https://registry.npmjs.org/-/all
npm info retry will retry, error on last attempt: Error: tunneling socket could not be established, sutatusCode=403
npm info retry registry request attempt 3 at 09:49:57
npm http GET https://registry.npmjs.org/-/all
npm ERR! Error: tunneling socket could not be established, sutatusCode=403
npm ERR! at ClientRequest.onConnect (/usr/local/lib/node_modules/npm/node_modules/request/tunnel.js:148:19)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:115:20)
npm ERR! at Socket.socketOnData (http.js:1383:11)
npm ERR! at TCP.onread (net.js:410:27)
该命令总是失败, sutatusCode
403 [原文如此] -这意味着未经授权的。 我已经设置了Authoxy不要求用户名/密码。 //用户:通@代理:端口,当我绕过Authoxy,并为我们在HTTP的形式NTLM代理真正代理凭据会发生同样的错误。
我怎样才能让通过代理这项工作?
更新
我创建了一个问题,在NPM项目报告此: https://github.com/isaacs/npm/issues/2866