Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install anything with npm ECONNRESET without proxy

Tags:

I used node.js to install some things via npm without any problems. Now I changed nothing on my settings (Win8; no proxy, internet is working) and I can't install anything (especially cordova and ionic). It only throws errors like I'm behind a proxy, but I'm not.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "i" "-g" "ionic"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
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!     D:\Web\dierechnungstimmt\npm-debug.log

and

    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])

Can anyone please help me?

EDIT: Tried to downgrade to node 0.10 an run cmd as administrator, but it still doesn't work:

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])
like image 422
bastifix Avatar asked Apr 01 '15 16:04

bastifix


People also ask

How do I fix npm install error?

If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).

What is write Econnreset?

"ECONNRESET" means the other side of the TCP conversation abruptly closed its end of the connection. This is most probably due to one or more application protocol errors. You could look at the API server logs to see if it complains about something.

Do I need to install node modules everytime?

We do not need to install a module every time when installed globally. It takes less memory as only one copy is installed. We can make . js scripts and run them anywhere without having a node_modules folder in the same directory when packages are installed globally.


2 Answers

Well, actually, I want to give a comment to your question. Because I have low reputation, it means I can't give a.

If you have a trouble with npm on Windows. I would suggest you take a look the common errors of npm on wiki here. Back to your problem, please make sure you are using internet connection along with proxy or not. If you are using it, please do command npm config set proxy. I found same problem on Stackoverflow and the solution is:

use

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

so that npm requests for http url instead of https.

and then try the same npm install command.

Don't forget to clear your cache by doing npm cache clean.

Although, this way can solve the problem. You should consider about the security. This way is not the safe way because it can lead to security problem since https is not used here. I don't recommend to use this on production (thanks @ivarni for pointing this out).

like image 149
meisyal Avatar answered Sep 20 '22 15:09

meisyal


The following worked for me

  1. Instead of using cmd, use the "Node.js commandprompt". To do this, type node in start menu, and on the results, click on "Node.js commandprompt". This will setup the required env variables
  2. In the above shell, run the command

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

  1. Run the command

npm install -g cordova

  1. Run the command

npm install -g ionic

like image 38
Sunil Purushothaman Avatar answered Sep 18 '22 15:09

Sunil Purushothaman