Unable to use 'npm install' on Windows 10 (error code ECONNRESET) - node.js

I have recently installed latest version of nodejs (6.3.1) with npm version 3.10.3. I am not able to install any node package using npm install command. Initially I thought it might be related with my office network firewall settings, but I am getting similar issue on my home network. Please see attached image for error details.
Appreciate if someone can help me to find a resolution.

npm config had bad network settings. So although I had disabled the main proxy / firewall etc. all npm commands were always going through that bad proxy. Managed to remove those bad entries finally, phew! :)

Related

npm install always ETIMEOUT can's fix

I have spent my whole day on fixing this problem but can't see any light.
My node and npm version is below
And no matter what package I wanna install, it always show
I am sure that I am not in any proxy and I have already lower my node version from 18 to 14,
but the problem still exist!!!!
Could anyone know how to fix this problem help me?
I already tried every way to fix this but can't work.
Since when did the issue start? Did it occur after you installed any dependency or made any proxy / firewall related configurations?
However you can try one of the following ways to fix this issue
Delete node_modules folder and in terminal, write
npm install
Change your nodejs version, either upgrade it or downgrade it
Reinstall nodejs
Try some other package manager like yarn
Note: When changing your nodejs version, please ensure that your node version is compitable with the npm version
Edit:
If these solutions don't work, the error is most probably caused by network related issues, you can try the following fixes
In terminal, reset the registry path of your node package manager
npm config set registry http://registry.npmjs.org/
If you are using your organization's computer, you need to use a proxy, remember to change the proxy url and port as per your organization
npm config set proxy http://proxyurl.com:8080
npm config set https-proxy http://proxyurl.com:8080
Instead of local installation, try installing packages globally i.e
npm install -g mongoose
Clear the cache
npm cache verify
Switch your device to some other wifi network and then try installing some npm packages

ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC - can't install node packages either via npm or yarn

Can't install node packages via npm or yarn
This has been happening to me since last month and I have tried multiple solutions from the internet including stack overflow solutions like https://stackoverflow.com/a/34945326/15488503
The problem is regenerated each time I run commands like
yarn install
npm install
npx create-react-app myapp
The error which I see mostly revolves around this error message -
ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
I have tried with multiple node and npm versions and still, the problem remains the same for me.
I had this problem when i was using internet via a USB Wifi adapter. Connected my computer with a cable solved my ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC problem
¯\_(ツ)_/¯
Besides updating your version of node to an active or current LTS you want to ensure your NPM registry is set to an HTTPS endpoint:
npm set registry=https://registry.npmjs.org/
After facing the issue for more than 6 months. I think I found a solution. It's VPN (virtual private network).
I realized that the issue was because of my network connection and was not a fault of NPM. Using VPN while downloading packages prevented that error.

How to resolve (reading 'isServer') error in npm?

Catch this error after npm i. Version npm - 8.0.0, nodejs - 16.11.0.
npm ERR! Cannot read properties of undefined (reading 'isServer')
I had the same issue with close versions of node and npm. I was using a shared connection from my phone since I wasn't home. When I get back home and used my WiFi things got back to normal.
If you are using such kind of connection then it is probably that causes this issue.
Try to use npm with specific version
for example i was trying to use npm install -g truffle and it did not work
but this one work npm install -g truffle#5.0.5
I updated npm and that fixed it!
You can update npm like so:
npm install -g npm#latest
If running this command doesn't work then you can try installing npm packages in an Admin Environment.
Hope this helps!
The issue could be due to the network, try to change the network and retry. This solved my issue :)
I've got the same issue, then I updated npm to 8.3.0, and the problem is solved.
Copying the npmrc.5 file from:
C:\Program Files\nodejs\node_modules\npm\man\man5 to C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm seemed to work for me:
Copy-Item -Path C:\Program Files\nodejs\node_modules\npm\man\man5 -Destination C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm –Passthru
Try stable Nodejs version 14.16.1 instead of 16.
Nodejs 14.16.1 Link
Update the latest version of Node.js. Then try to install npm the issue won't come.
Check out this URL https://nodejs.org/en/
and install a version recommended for most users.
I had this same issue, turning off all port forwarding on my router helped.
Whenever, I saw this problem. I restarted the computer and it working immediately.
I recommend trying this solution.
Based on what I've read on issues related, it seems like there's conflicting global packages and node versions.
Please try uninstalling both node and npm and try again.
Check out these issues for more details:
Node error Cannot read property 'resolve' of undefined
Cannot read property 'resolve' of undefined when using npm to install a package
I had the same issue and tried all the possible solutions. None of them worked.
And finally, when I restarted my PC, it worked like a charm :).
It happened to me because of the node.js version and an npm update.
Uninstall nodejs
Delete folder C:\Users\Administrator\AppData\Roaming\npm
Install nodejs (v17.x)
In your project folder:
npm install -g npm#8.3.2
npm i --package-lock-only
npm audit fix --force
It worked for me. I hope it helps you :)
When I had this problem, I was trying to deploy my NodeJs server in Heroku. The problem was I forgot to load the enviroment variables manually, so it was related to the connection to the DB, that was failing.
It happened also locally for the same reason and it was still related to the failing connection to the DB.
I kept running into this problem in different scenarios. I found that because I had used a VPN during my computer session, but not during the time I ran 'npm install', it was throwing this error. I simply reinstalled and restarted and did not enable my VPN during that session. Although, you may not have to completely reinstall-- only restart you PC without using a VPN after restart-- I do not know as I have not tried.
(Specifically I was using Express VPN)
Update: I ran into the problem again immediately after a fresh install and restart. Again I restarted my computer (without a fresh install as I had just reinstalled it.) This seemed to work for the moment. Will update with any permanent fixes I come across.

Polymer is not installing in mac

I am trying to install polymer in my mac machine using npm. I have done all the required config settings to work npm behind proxy. Still i am not able to install the polymer. Please check the error shown in the screen shot. Can anyone help me to find the solution of this?

Create an offline installer of npm package

Problem:
I have a very flaky internet connection at my place.
Due to this when I try to do
npm install -g glup
it stops the download before completion.
I have tried downloading several times but all in vain.
Thinking about my options
I have a friend in other city with high speed internet, I can ask him to somehow package the glup and provided it to me using dropbox, then i can use any download manager to download it partially with my flaky connection.
But the sad thing is he doesn't know how to do it. (help on this front is also appreciated)
Can anyone help me out with this situation?
P.S: I am doing a course from Udacity and due to my flaky internet connection I am kind of facing lot of issues.
According to the docs, npm install supports installing from a tarball file sitting on your filesystem. So, as long as your friend can create and supply you a tarball of the npm package you are looking for - you should be good to go.
Below is a quote from the docs.
UPDATE: To create a tarball file from an npm package, you can just run npm pack package_name. For example,
npm pack underscore
will create a .tgz file for the latest version of underscore.js npm package. See the documentation for npm pack here.
Not answering directly your question, but I was just struggling with network connection behind a corporate firewall with npm for hours. Then I tried yarn, the package manager from Facebook. Wow, it worked like a charm, install of the package I needed plus deps. done within a minute.

Resources