簡體   English   中英

npm問題安裝在公司代理后面

[英]Issue with npm Install behind a corporate proxy

我遵循以下步驟:

第1步:我嘗試使用以下命令克隆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配置

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)

Step3:現在我打開了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 

任何工作都將非常感激。

您可能需要安裝中間摘要代理(例如cntlm,請參閱http://cntlm.sourceforge.net/ ),具體取決於您的代理需求。

您可以使用此命令找到圖形瀏覽器使用的代理:(請參閱https://github.com/npm/npm/issues/7156

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM