Skip to content

Proxying npm packages using Nexus

In this post, you will learn how to use your Nexus npm proxy repository as a proxy for your node js project’s npm packages. You also learn how to concfigure npmrc for proxying npm packages from Nexus.


Nexus is a repository manager that helps in managing your project’s dependencies, artifacts & metadata, docker images, binaries, JARs and proxying to external repositories. It’s a must have tool when your project is incubated from early stages.

One of the users of Nexus is to proxy the npm packages to the official npm registry. Whenever you applications installs an npm package from the official npm registry, you can cache it to your Nexus repo manager and next time if your app tries to install the npm packages, it will be proxied from Nexus. This way you can speed up the installation time of your application. Here are the steps.


Create an npm proxy repository in Nexus

Create a new repository that proxies to the official npm registry.


Hash your Nexus login credentials

Hash your login credentials with the following command. I suggest you to use an account with developer role and not the admin role. We need this hash value later.

echo -n 'anand:nexus@123' | openssl base64

Add registry details to npmrc file

Create an npmrc file at the project level or globally and add the following details.

Registry URL, Email ID and Auth token that we created in the previous step.


Next time when you do an npm install, your npm packages will be cached to your Nexus.

See also  Error: ENOSPC: System limit for number of file watchers reached - How to fix this NPM error?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.