2014-05-21 93 views
1

當我嘗試從npmjs站點安裝bower或yeoman時,我的「cmd」命令就像發生此錯誤一樣。這裏是錯誤:無法使用「cmd」命令在配置後安裝bower和yeoman

D:\bow>npm install -g yo grunt-cli bower 
npm http GET https://registry.npmjs.org/yo 
npm http GET https://registry.npmjs.org/grunt-cli 
npm http GET https://registry.npmjs.org/bower 
npm http GET https://registry.npmjs.org/yo 
npm http GET https://registry.npmjs.org/grunt-cli 
npm http GET https://registry.npmjs.org/bower 
npm http GET https://registry.npmjs.org/yo 
npm http GET https://registry.npmjs.org/grunt-cli 
npm http GET https://registry.npmjs.org/bower 
npm ERR! network tunneling socket could not be established, cause=getaddrinfo EN 
OTFOUND 
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 settin 
gs. 
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! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod 
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yo" "grunt-cli" "bower" 

npm ERR! cwd D:\bow 
npm ERR! node -v v0.10.26 
npm ERR! npm -v 1.4.3 
npm ERR! code ECONNRESET 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  D:\bow\npm-debug.log 
npm ERR! not ok code 0 

我的用戶名是「mb112830」,密碼爲「TECHM @ 112830」,我的服務器是「MSAT」和端口是80的話,檢查它顯示我的NPM的配置像這樣:

D:\bow>npm help config 

D:\bow>npm config list 
; cli configs 
registry = "https://registry.npmjs.org/" 

; userconfig C:\Users\mb112830\.npmrc 
https-proxy = "http://mb112830:TECHM%[email protected]:80/" 
proxy = "http://mb112830:TECHM%[email protected]:80/" 
regisry = "http://registry.npmjs.org/" 

; builtin config undefined 
prefix = "C:\\Users\\mb112830\\AppData\\Roaming\\npm" 

; node bin location = C:\Program Files\nodejs\\node.exe 
; cwd = D:\bow 
; HOME = C:\Users\mb302811 
; 'npm config ls -l' to show all defaults. 

都是正確的。我也將環境變量設置爲我的計算機屬性。還有什麼我需要做進一步檢查直接使用「cmd」命令npm模塊?

任何人都可以幫我解決這個問題嗎?如果發現任何錯誤,請突出顯示

在此先感謝!

這裏是什麼信息我的 '.npmrc' 文件包含

proxy = http://"mb302811:[email protected]"@msat:80/ 
    https-proxy = http://"mb302811:[email protected]"@msat:80/ 
    registry = http://registry.npmjs.org/ 

感謝。

回答

0

似乎問題是由於您的密碼中有「@」。
嘗試用「引號」圍繞用戶名和密碼。

npm config set proxy http://"user:[email protected]"@proxy:port 
+0

當然讓我試試並找回你。 – 3gwebtrain

+0

我更新了。仍然只有錯誤。是否需要在系統環境中進行更新?也是可變的? – 3gwebtrain

+0

你能否粘貼你的.npmrc文件。它可能在c:\ users \ \ .npmrc –