2015-04-01 78 views
17

我使用node.js通過npm安裝了一些沒有任何問題的東西。現在我沒有改變我的設置(Win8的;沒有代理,互聯網工作),我不能安裝任何東西(特別是科爾多瓦和離子)。 它只會拋出像我在代理後面的錯誤,但我不是。無法使用npm ECONNRESET安裝任何代理

npm WARN engine [email protected]: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.1","npm":"2.5.1"}) 
npm WARN engine [email protected]: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.1","npm":"2.5.1"}) 
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.1","npm":"2.5.1"}) 
npm ERR! fetch failed https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.0.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/gaze/-/gaze-0.5.1.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/through2/-/through2-0.6.3.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.0.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/clone/-/clone-0.2.0.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
npm ERR! fetch failed https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
C:\Users\Basti\AppData\Roaming\npm\cordova -> C:\Users\Basti\AppData\Roaming\npm\node_modules\cordova\bin\cordova 
npm ERR! fetch failed https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz 
npm WARN retry will retry, error on last attempt: Error: read ECONNRESET 
C:\Users\Basti\AppData\Roaming\npm\ionic -> C:\Users\Basti\AppData\Roaming\npm\node_modules\ionic\bin\ionic 
[email protected] C:\Users\Basti\AppData\Roaming\npm\node_modules\i 

[email protected] C:\Users\Basti\AppData\Roaming\npm\node_modules\cordova 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] ([email protected]) 
ÔööÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

[email protected] C:\Users\Basti\AppData\Roaming\npm\node_modules\ionic 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] ([email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
Ôö£ÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
ÔööÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 

任何人都可以幫我嗎?

編輯: 試圖降級到節點0.10下運行cmd以管理員身份,但它仍然不能正常工作:

C:\Users\Basti\Desktop>npm install i -g cordova 
npm WARN engine [email protected]: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.10.38","npm":"2.7.4"}) 
npm WARN installMany normalize-package-data was bundled with [email protected], but bundled package wasn't found in unpacked tree 
C:\Program Files (x86)\nodejs\cordova -> C:\Program Files (x86)\nodejs\node_modules\cordova\bin\cordova 
[email protected] C:\Program Files (x86)\nodejs\node_modules\i 

[email protected] C:\Program Files (x86)\nodejs\node_modules\cordova 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] 
Ôö£ÔöÇÔöÇ [email protected] ([email protected]) 
ÔööÔöÇÔöÇ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
+0

嘗試打開命令行作爲管理員?這是否會產生差異? – 2015-04-01 19:29:16

+0

嘗試與'powershell',它的成功與我 – 2015-05-29 01:41:40

+0

可能重複的[NPM不工作 - 「讀ECONNRESET」](http://stackoverflow.com/questions/18419144/npm-not-working-read-econnreset) – mithunsatheesh 2015-09-01 04:21:21

回答

25

嗯,其實,我想給你的問題的註釋。因爲我的聲譽很低,這意味着我無法對你發表評論。

如果您在Windows上遇到npm問題。我建議你看看wiki herenpm的常見錯誤。回到您的問題,請確保您使用互聯網連接與代理或不。如果您正在使用它,請執行命令npm config set proxy。我發現同樣的問題上Stackoverflow和解決的辦法是:

使用

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

所以http網址,而不是https是NPM請求。

然後嘗試相同的npm install命令。

不要忘記通過做npm cache clean來清除緩存。

雖然這樣可以解決問題。你應該考慮安全性。這種方式是不是安全的方式,因爲它可以導致安全問題,因爲https不在這裏使用。我不建議在生產中使用它(謝謝@ivarni指出這一點)。

+1

謝謝, 人!我不得不從我的Mint箱子降級到這塊s ** t windows 8,我已經花了一個星期的時間來試圖構建我的開發環境。這完全擺脫了網絡錯誤。 – 2015-07-04 18:29:47

+0

我要去哪裏去誇讚你十次? :-) – 2015-09-12 07:15:14

+0

謝謝。 +1這也幫助了我。 – Pankaj 2016-09-02 20:41:47

4

以下爲我工作

  1. 而不是使用CMD的,使用 「Node.js的commandprompt」。爲此,請在開始菜單中鍵入節點,然後在結果上單擊「Node.js commandprompt」。這將設置所需的env變量
  2. 在上述外殼中,運行指令

NPM配置組註冊表http://registry.npmjs.org/

  • 執行命令
  • npm install -g cordova

  • 執行命令
  • NPM安裝-g離子

    0

    曾與節點V5.0.0在Windows 10的類似問題

    here的另一個解決方案適用於我:

    T ry解除x64版本的Node.js並安裝x86一個。

    0

    ECONNRESET問題的最好的討論是在這個NPM註冊表票: https://github.com/npm/registry/issues/10

    TL;博士:如果您經常看到這個頁面,這可能是可以解決的「併發連接太多」的問題通過將您的npm版本更新爲2.15.x3.x/latest

    關於Shokatsuryō-san發表的帖子的一條評論(沒有直接評論)& Sunil:都建議將您的npm註冊表配置更改爲通過https使用http。這樣做會在生產環境中帶來重大的安全風險;在這些情況下不要使用該修復程序。

    0

    我實際上有同樣的問題,從我的工作場所我可以安裝一切正常,但它不是在家工作。 我發現在我的routeur上設置的自定義DNS是問題,我已經恢復到默認的Internet提供商之一,一切正常。

    0

    我有類似的問題。

    我下面運行命令

    NPM配置編輯

    打開該文件,並刪除線無約8 代理= http://github.com/ 註冊表= http://registry.npmjs.org/ 這些都是用戶自定義設置刪除此文件並保存。

    運行以下命令 npm install應該可以正常工作。

    +0

    npm install應該可以工作 – bharat 2017-05-31 07:14:18