antpaw antpaw - 1 year ago 316
Javascript Question

using myproject/.npmrc with registry

How do I setup a .npmrc file inside my project where I can define my own private registry? I don't want to have this kind of configuration in my user config .npmrc. Every other developer should be able to just

git clone
the project and run
npm install

This is what I have so far:

// .npmrc

// package.json:
"name": "webapp",
"description": "",
"version": "1.0.0",
"private": true,
"dependencies": {
"jquery": "1.2.3",
"myPrivateLibFromNpmFury": "0.0.4"

npm install myPrivateLibFromNpmFury


npm ERR! 404 Registry returned 404 for GET on

Answer Source

As it was pointed out by @Paulpro and @Alexey B. the most parts of it worked already, but I couldn't see it right away, maybe because I didn't reload my bash environment properly. But after that I faced other issue with npm outdated that was caused by the registry url. It turns out npm can only have one registry url, (which is pretty crazy) and if you want to use private and public npm-modules you have to proxy the public npm-module registry through your private registry. Luckily this is what supports, so in my case instead of using this:


i have to use this:


UPDATE: It is possible to work around the problem with npm tight to only one registry. First you have to add to all of your private packages a scope. With .npmrc you can now link the registery for the scopes, and you no longer need any proxies at all.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download