Private NPM Sinopia注册表安装错误

时间:2013-12-06 14:25:40

标签: node.js registry npm

我开始使用NPM,我正在使用Sinopia作为私人npm注册表的 解决方案 。所以我的第一个命令是:npm install -g sinopia我失败了很多错误所以我咨询了requirement modules。所以在安装完所有内容之后,错误的数量正在减少,这就是我所得到的:

C:\Users\tuto>npm install sinopia
npm http GET https://registry.npmjs.org/sinopia
npm http 304 https://registry.npmjs.org/sinopia
npm http GET https://registry.npmjs.org/fs-ext
npm http 304 https://registry.npmjs.org/fs-ext

> fs-ext@0.3.2 install C:\Users\tuto\node_modules\sinopia\node_modules
\fs-ext
> node-gyp configure build


C:\Users\tuto\node_modules\sinopia\node_modules\fs-ext>node "C:\Progra
m Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bi
n\node-gyp.js" configure build
gyp http GET http://nodejs.org/dist/v0.10.19/node-v0.10.19.tar.gz
gyp http 407 http://nodejs.org/dist/v0.10.19/node-v0.10.19.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 407 status code downloading tarball
gyp ERR! stack     at Request.<anonymous> (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\install.js:222:14)
gyp ERR! stack     at Request.EventEmitter.emit (events.js:117:20)
gyp ERR! stack     at Request.onResponse (C:\Program Files\nodejs\node_modules\n
pm\node_modules\request\request.js:812:10)
gyp ERR! stack     at ClientRequest.g (events.js:175:14)
gyp ERR! stack     at ClientRequest.EventEmitter.emit (events.js:95:17)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (http.js:1689:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete]
(http.js:120:23)
gyp ERR! stack     at Socket.socketOnData (http.js:1584:20)
gyp ERR! stack     at TCP.onread (net.js:525:27)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\tuto\node_modules\sinopia\node_modules\fs-ext
gyp ERR! node -v v0.10.19
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

有人可以帮我吗?并告诉我问题出在哪里?

非常感谢你..

1 个答案:

答案 0 :(得分:1)

问题在于:

  

gyp http 407 http://nodejs.org/dist/v0.10.19/node-v0.10.19.tar.gz

407来自HTTP请求的响应意味着需要代理身份验证。

以下是添加用户名/密码凭据的方法:

npm config set proxy http://username:password@proxy.company.com:1234
npm config set https-proxy http://username:password@proxy.company.com:4567

如果用户名包含at符号(@)以转义它,请在用户名周围使用引号。

<强>参考