Here is the solution to ECONNRESET issues while working with npm
- npm install -g ionic fails with ECONNRESET
- npm ERR! network read ECONNRESET
It is a quite common error which occurs while installing modules using npm e.g. ionic
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! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova" "ionic" npm ERR! node v4.2.2 npm ERR! npm v2.14.7 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read
What is the solution?
This can be resolved by updating npm registry protocol from https:// to http://
$ npm config get registry https://registry.npmjs.org/$ npm config set registry http://registry.npmjs.org/$ npm config get registry http://registry.npmjs.org/