gpt4 book ai didi

node.js - 私有(private) NPM Sinopia 注册表安装错误

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

我开始使用 NPM 并乞求 Sinopia作为私有(private) 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

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

非常感谢..

最佳答案

问题在这里:

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

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

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

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

如果用户名包含 at 符号 (@),请使用引号将其转义。

引用文献

关于node.js - 私有(private) NPM Sinopia 注册表安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20426257/

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