I’ve been a huge fan of Nexus for inhouse proxying of Maven artefacts for years. I’ve used it at heaps of government sites where it was a hassle to get internet access through content proxies, and it’s been a life saver. But you might not know that Nexus is also awesome for proxying NPM, Bower and even Docker images.

If you need to configure your local npm to point to Nexus, there’s awesome docs on that.

Yarn is npm with win

However, I’ve now started experimenting with yarn, Facebook’s drop in replacement for npm (but quite a bit faster!), and so was naturally wondering how to configure it to use my local Nexus proxy.

Turns out it’s simply a matter of:

yarn config set registry http://localhost:8081/repository/npm-central/

And you’re off and running. I thought I would write it down so I can google it later!

You can confirm that life is great, but tailing your /nexus/log/request.log and watch the traffic flowing (or try a yarn install --verbose and sit back!).

Have fun!