npm安裝bower時報錯 我已解決

錯誤代碼:html

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "E:\\node\\\\node.exe" "E:\\node\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ECONNRESETnode

npm ERR! network tunneling socket could not be established, cause=connect ECONNREFUSED
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

npm ERR! Please include the following file with any support request:
npm ERR! E:\study\angular-phonecat\npm-debug.logsocket

 

解決辦法:spa

刪除npmrc文件。命令行

 

使用鏡像debug

 

 

鏡像使用方法(三種辦法任意一種都能解決問題,建議使用第三種,將配置寫死,下次用的時候配置還在):代理

1.經過config命令code

1htm

2

npm config set registry http://registry.cnpmjs.org

npm info underscore (若是上面配置正確這個命令會有字符串response)

2.命令行指定

1

npm --registry http://registry.cnpmjs.org info underscore

3.編輯 ~/.npmrc 加入下面內容

npm config set registry=http://registry.cnpmjs.org

 

其實就是代理的問題, npm set proxy http://… npm set https-proxy http://… 後解決了

 

以上參考資料 《npm ERR!沒法安裝任何包的解決辦法》http://www.daliane.com/npm_err_wu_fa_an_zhuang_ren_he_bao_de_jie_jue_ban_fa/

《npm用法及離線安裝方法》http://www.cnblogs.com/laozhbook/p/3637036.html

——————————————————————

個人:

相關文章
相關標籤/搜索