npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

.npmrc registry for non-scoped module?

We have a situation where a vendor offers a library that has the same name as one on the public npm registry, but we have to install it from a private registry;

So: npm install foo --registry=https://someprivateregistry works, but people keep trying to add foo to their package.json which causes the public one to be installed. If this were a scoped module, we could configure .npmrc to override @scope but it’s not. It’s just called foo.

Is there a way to configure .npmrc so that it targets a registry for a plain-named, non-scoped package?