Home > Blockchain >  ECONNRESET error when installing with npm while behind a proxy
ECONNRESET error when installing with npm while behind a proxy

Time:06-02

I am getting this error when trying to install packages using npm :

[![Error Message][1]][1]

From what I read, it is about not being able to connect to https://registry.npmjs.org/

I tried using npm config set registry but it did not solve the problem.

What could be stopping this from working?

BTW, I found a solution. The solution is to switch the internet. I suppose this occurs because of dorm's connection. Thanks for everything [1]: https://i.stack.imgur.com/zFdpS.png

CodePudding user response:

If you have a proxy issue like when your company is using Artifactory as NPM registry, you can try (work on Windows):

cd ~ # go to user directory
touch .npmrc # create the file if don't exist

Edit the file and add:

registry https://artifactory.your-domain.fr/artifactory/api/npm/npm-virtual/=
registry=https://artifactory.your-domain.fr/artifactory/api/npm/npm-virtual/
# strict-ssl=false # you may need that if you company install an intermediate certificate on your machine (they spy on you HTTPS ;)).

Where your-domain.fr is to be replaced.

CodePudding user response:

Have you tried below?

npm --without-ssl --insecure i ethers

If you know the details of the proxy you are using:

npm config set proxy http://[username]:[password]@[host]:[port]
  •  Tags:  
  • npm
  • Related