-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not auto-detect NPM registry from .npmrc? #73
Comments
It could certainly shell out to npm config get registry. |
This would be a huge improvement. As far as I can tell, this project right now is unusable because our corporate requirements result in needing to use multiple regestries, which are separated by package namespaces: Example
|
Hmm, I'm not sure how that would work with |
The point of this script is to install peer dependencies for a specified package, right? Seems this package could do that by just passing each found package to |
That's basically what it's already doing: https://github.com/nathanhleung/install-peerdeps/blob/master/src/install-peerdeps.js#L84-L103 Since it's using I think the issue is that getPackageData is making a direct request to the registry. I think the solution is, to shell out to |
Yeah, since |
A PR would be appreciated. |
I'm not sure how to address it in this project without significant restructuring of the interfaces being exposed. In the script I've built privately, I've avoided all the registry and proxy passing entirely (that adds a huge amount of complexity with the corporate proxies I have to deal with). Instead of using the remote registry to get package data or |
It seems like just a refactor in |
I'll take a look at branching this and see what I come up. |
Fixes #73 Removes a bunch of custom logic and leverages the "info" command that all package managers provide for getting package details from a remote registry. By using the package tool, we can delegate proxy configs, private registry paths, and auth tokens to the package manager. This is especially valuable in networks that require complex proxy configurations, or when packages have peerDependencies that may be in multiple other private than the singular one that was specified BREAKING_CHANGE: removes `--registry` `--auth` and `--proxy` options Use `.npmrc` or `.yarnrc` to mange private registry paths, auth tokens, and proxy configs
I see in discussion from #16 that the OP wanted to install dependencies in a package from a private registry, and the subsequent support for that through the
--registry
option.My question is, why does
install-peerdeps
not work alongsidenpm
(oryarn
) by using settings that are already set in~/.npmrc
(or~/.yarnrc
), especially with respect to use of a private NPM registry.For example, I have published
eslint-config-myconfig
in my private registry, the URL of which I've configured in my~/.npmrc
file. So, if I run this command to query the package's peer dependencies:It just works!
The same should be true when it comes to installing those peer dependencies. When spawning a child process to run
npm
(oryarn
), just let the underlying package manager read its own configuration file.The text was updated successfully, but these errors were encountered: