2016-08-16 58 views
1

嘗試安裝節點檢查,我得到的錯誤:解決網絡隧道插座無法建立錯誤

npm ERR! Linux 4.4.0-21-generic 
npm ERR! argv "/home/hira/.nvm/versions/node/v4.4.7/bin/node" "/home/hira/.nvm/versions/node/v4.4.7/bin/npm" "install" "-g" "node-inspector" 
npm ERR! node v4.4.7 
npm ERR! npm v2.15.8 
npm ERR! code ECONNRESET 

npm ERR! network tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:5002 
npm ERR! network This is most likely not a problem with npm itself 
npm ERR! network and is related to network connectivity. 
npm ERR! network In most cases you are behind a proxy or have bad network settings. 
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the 
npm ERR! network 'proxy' config is set properly. See: 'npm help config' 

npm ERR! Please include the following file with any support request: 

我基本上基於節點的thin模塊上的一個項目,跑的HTTP/HTTPS MITM代理上127.0.0.1:5002

閱讀關於這個問題的一些答案,我試圖通過使用以刪除代理服務器設置:

npm config rm proxy 
npm config rm https-proxy 

爲以及

npm config set proxy = null 

所以當我NPM配置ls -l命令它表明這兩個設置爲空。但是,它仍然拒絕安裝。我甚至試圖刪除我的系統網絡代理設置。

任何人都可以幫助解決這個問題嗎?我在Virtualbox上運行Ubuntu 16.04上的節點v4.4.7和npm版本2.15.8。謝謝。

+1

也許是在一個仍然可用環境變量? '$ HTTP_PROXY'或$ $ http_proxy'很常見。 – robertklep

+0

我試着檢查我的環境變量,這些變量出現在列表中:'http_proxy = http://127.0.0.1:5002 /' 'https_proxy = http://127.0.0.1:5002 /' 'HTTPS_PROXY = http: //127.0.0.1:5002 /' 'HTTP_PROXY = http://127.0.0.1:5002 /' 我可以將這些設置爲空嗎? – QPTR

+2

'unset http_proxy https_proxy HTTPS_PROXY HTTP_PROXY' – robertklep

回答

1

正如robertklep和評論QPTR指出,消除環境變量解決了這個問題對我來說

HTTP_PROXY

https_proxy

HTTPS_PROXY

HTTP_PROXY

相關問題