Skip to content
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

Add support for private registries #319

Closed
sventschui opened this issue Jan 29, 2021 · 1 comment
Closed

Add support for private registries #319

sventschui opened this issue Jan 29, 2021 · 1 comment

Comments

@sventschui
Copy link
Member

sventschui commented Jan 29, 2021

Add support for .npmrc and private registries.

  1. API in
    const API = 'https://registry.npmjs.org';
    should not be hardcoded but rather resolved by looking for a .npmrc file up in the tree and resolve the registry from there. This should also support registries specified for certain scopes. Related to Make npm registry url configurable #167
  2. Add support for authenticated registries. Use credentials from .npmrc or ask for it in interactive mode

See https://github.com/yarnpkg/yarn/blob/a4708b29ac74df97bac45365cba4f1d62537ceb7/src/registries/npm-registry.js for some inspiration

Edit: A "simple" solution could be to run npm config list --json and parse its JSON output. It will give the registry config in the registry and @<scope>:registry keys. Also it provides userconfig and globalconfig keys that can be used to try to lookup auth tokens in these files. Also <registry_url>:always-auth keys should be respected to send credentials when trying to resolve packages.

@marvinhagemeister
Copy link
Member

Let's track this in #167 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants