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?
npm-registry-mirror is a utility for mirroring a subset of npm packages from another npm registry. It syncs all of the dependencies for a particular node module and writes them to the local filesystem so that a simple webserver can behave like a read-only For more information about how to use this package see README.
Verdaccio is a simple, zero-config-required local private NPM registry. No need for an entire database just to get started. Verdaccio comes out of the box with its own tiny database, and the ability to proxy other registries (eg. npmjs.org), also introduces caching the downloaded modules along the way.
Per-project config file npmrc file in the root of the project (ie, a sibling of node_modules and package. json ) will set config values specific to this project.
use 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With