Using the European npm mirror

If you are located in Europe the European npm mirror is fast and reliable. With a few tweaks you can easily publish to the main registry too.

The mighty Maciej Malecki created a European npm mirror for all the Node.js developers this side of the Atlantic. It is much faster to install packages from and takes some load off the main registry.

Here are some stats™ on installing the yeoman-generator module.

npm install --registry yeoman-generator  10.09s user 1.62s system 47% cpu 24.473 total
npm install --registry yeoman-generator  6.10s user 1.11s system 34% cpu 20.903 total

So 6.10 seconds in Europe, 10.09 seconds from the main registry. Four seconds faster.

You can start using the European mirror right away by running a single command.

npm config set registry 

This will update your .npmrc to include the following line

registry =

Now when you run npm install if you haven't disabled verbose logging you'll see the http calls going out to the European mirror.

npm http GET
npm http GET


You cannot publish to the European mirror - it is read only. This means there is a little bit of work to do when you want to publish a module. There are a couple of ways to achieve this. You can simply specify the registry when you publish

npm publish --registry

Or you can set this in your package.json file

"publishConfig": {


If you frequently want to switch modules the nrm module may help.

$ nrm ls

* npm ----
  cnpm ---
  eu -----
  au -----
  sl -----
  nj -----

$ nrm use cnpm  //switch registry to cnpm

Thanks to for this tip.


If you are in Europe enjoy a faster, sexier npm experience by switching to the European registry! You can also bask in the warm glow of being a good npm citizen by taking some load off the main repository.

Given CouchDB's excellent replication capabilities it would be nice to see more mirrors popping up. You could even write a proxy in front of the mirrors to make sure you always have a service available.

Have an update or suggestion for this article? You can edit it here and send me a pull request.