The npm registry is down again, resulting in npm install
not working.
Question: How do we use npm
to pull packages from npm mirrors? Are there any recommended npm mirrors?
The npm registry is down again, resulting in npm install
not working.
Question: How do we use npm
to pull packages from npm mirrors? Are there any recommended npm mirrors?
3 Answers
Reset to default 13use the npm mirror
npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com
you can reset this later with npm set registry
npm set registry https://registry.npmjs.org/
then use it normally:
npm install express
You can also see this gist for more information on the above solution.
Here is a Gist with what seems to be complete instructions for setting up a mirror, with a demo mirror/example.. Not sure if that person's mirror is still running, but the example provided seems simple enough:
$ npm set registry http://domain.of.your.npm.mirror.com
As the question passed almost ten years, I will recommand you to use pnpm in 2023, set the mirror registry like this:
pnpm set registry https://registry.npmmirror.com/