The Easiest Way to Fix NPM “ECONNRESET” Error
If you live in a country with limited access to the internet, and you happen to be a programer like I am, you may encounter the subject error message.
What this means is that you are unable to access the resources, namely the package that you are attempting to download locally.
Using a VPN may seem like an easy fix, but terminals, such as bash and powershell, do not work as well with VPN. In addition, even if you are able to route your traffic, chances are you will be blocked because of how GREAT the firewall is.
As a result, we have other options, such as setting your npm origin to mirror sites in your country, or mirrors that are not blocked.
However, I don’t want to go that route, I dislike getting packages from mirror sites.
Then we have another option, which is to manually download the package from the source and put it in the npm cache folder so that when you do “npm i”, there will be no need for the internet.
To illustrate, here’s how it works on my Windows computer:
Step1: Navigate to npm cache bycd ~cd /AppData/Roaming/npm-cacheStep2: CD to the targarted package folder, such ascd _libvipsStep3: Manually download the package from githubStep4: Put the zip folder into the folder