npm问题安装在公司代理后面

时间:2015-02-24 09:23:32

标签: node.js git proxy npm

我遵循以下步骤:

Step1:我尝试使用以下命令克隆AngularJS Tutorial存储库

git clone https://github.com/angular/angular-phonecat.git

repo在我的C:\ Git

中成功克隆了

由于我在公司代理背后工作,并且我从各种论坛检查了我必须设置http_proxy和https_proxy,所以我执行了Step2。

第2步:创建环境变量http_proxy和https_proxy

http_proxy = http://userid:PASSWORD%24%25@domain:port 
https_proxy = https://userid:PASSWORD%24%25@domain:port 

设置npm config

npm config set proxy http://userid:PASSWORD%24%25@domain:port 
npm config set http_proxy http://userid:PASSWORD%24%25@domain:port 
npm config set https_proxy http://userid:PASSWORD%24%25@domain:port

($符号为%24,%符号为%25)

第3步:现在我打开了node.js命令提示符。 然后我将directroy更改为C:\ Git \ angular-phonecat并在下面的命令中输入。

C:\Git\angular-phonecat>npm install
npm WARN optional dep failed, continuing fsevents@0.3.5
|


> ws@0.4.32 install C:\Git\angular-phonecat\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)


C:\Git\angular-phonecat\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws>node "C:\Program Files\nodejs\node_modules\
npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
npm ERR! fetch failed https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz
|
> angular-phonecat@0.0.0 postinstall C:\Git\angular-phonecat
> bower install

bower bootstrap#~3.1.1    ECONNREFUSED Request to https://bower.herokuapp.com/packages/bootstrap failed: connect ECONNREFUSED

npm ERR! angular-phonecat@0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat@0.0.0 postinstall script.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower install
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Git\angular-phonecat
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Git\angular-phonecat\npm-debug.log
npm ERR! not ok code 0 

非常感谢任何工作。

1 个答案:

答案 0 :(得分:0)

您可能需要安装中间摘要代理(例如cntlm,请参阅http://cntlm.sourceforge.net/),具体取决于您的代理需求。

您可以使用此命令找到图形浏览器使用的代理:(请参阅https://github.com/npm/npm/issues/7156

reg query "HKCU\software\microsoft\windows\currentversion\internet Settings" /v "ProxyServer"