This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

NPM repository mirrors

How to configure NPM use an NPM repository mirror

Table of Contents

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.