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
npm install myPrivateLibFromNpmFury
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/myPrivateLibFromNpmFury
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 fury.io supports, so in my case instead of using this:
i have to use this:
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.
.npmrc you can now link the registery for the scopes, and you no longer need any proxies at all.
//.npmrc @project_a:registry=https://npm.fury.io/AUTH_TOKEN/USER_NAME/ @project_b:registry=https://npm.fury.io/AUTH_TOKEN/USER_NAME/ @company_a:registry=https://npm.fury.io/AUTH_TOKEN/USER_NAME/