If you use Private npm registry and that npm registry is added to your global
.npmrc file, then you probably faced this issue.
So, on the global
.npmrc file, there is one entry like
Let's say, you wanted to add
emotion to the project.
yarn add emotion
Then you probably see the error-
An unexpected error occurred: "https://myprivatenpmregistry/npm/emotion: connect ECONNREFUSED IP:PORT”.
We can fix this issue easily by adding
.npmrc file inside the root directly of the project. Then It will not use the global npm registry and will use the project level
.npmrc file we will add -
That's the small trick we can do to make it work.
If I have multiple projects with different npm registry then we can add that particular registry to the project level .npmrc and voila 🎉
My Blog: https://shahjada.me