NPM repository mirrors

How to configure NPM use an NPM repository mirror

Configuring NPM to use Nexus as a proxy is simple.

First ensure you've created the NPM proxy.

Next, edit or create the file .npmrc in your home directory with the following line:

1registry=http://10.11.12.13:8081/repository/npm-proxy

Where 10.11.12.13 is where you have deployed Nexus and npm-proxy is what you called your NPM proxy. If you've configured a group then use the group's name instead, e.g. npm-group

Obviously if you've configured https and dns then use that and not port 8081.

Now any time you run npm it will use your proxy.


Last modified October 30, 2021: Add npm repositories (ecebbba)