npm ERR!沒法安裝任何包的解決辦法

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 ECONNRESET

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 ERR! Please include the following file with any support request:
npm ERR! E:\study\angular-phonecat\npm-debug.log

錯誤代碼如上:node

解決辦法:npm

刪除npmrc文件。socket

使用鏡像spa

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

1.經過config命令debug

1code

2ci

npm config set registry http://registry.cnpmjs.org字符串

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

2.命令行指定

1

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

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

1

registry = http://registry.cnpmjs.org

相關文章
相關標籤/搜索