The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
npm install: allow per-package registry setting
Pre-Reading Note: Keep in mind that “publishConfig” does not provide the feature I am describing here. “publishConfig” specifies what registry a package should be published to, but what I am describing here is a way to specify what registry a package should be installed/downloaded from.
What’s the feature?
It would be nice if npm configuration could allow setting registry config for a specific package. Currently, npm allows setting a particular registry for scoped packages:
This instructs npm that, upon install, any package residing in the scope “@somescope” will be downloaded from “someotherregistry.com”. It would be nice if this could be extended to allow the user to specify that a given package–not just packages from a specific scope-- should be installed from a particular registry:
registry=https://registry.npmjs.org @somescope:registry=http://someotherregistry.com a-particular-package:registry=http://registry3.com
What problem is the feature intended to solve?
Before npm supported scoped packages, we published several internal packages to our own private registry. While the ideal fix would be for us to migrate our packages to being scoped packages, it would be nice to have the above feature for the interim.
Is the absence of this feature blocking you or your team? If so, how?
This is not blocking. It would just be a “nice-to-have”.
Is this feature similar to an existing feature in another tool?
Yes, scoped-package config (as mentioned above).
Is this a feature you’re prepared to implement, with support from the npm CLI team?
Perhaps, with a little direction, I could possibly submit a PR for this.
Haha zkat, thanks for the edits