-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
I want to add dist-tags using npm dist-tag add ... in a private repository.
As of NPM v6.14.15 it was possible, to authorize the user using the npm_config__auth environment variable.
I think that was done by this line: https://github.com/npm/cli/blob/v6.14.15/node_modules/npm-registry-fetch/auth.js#L22
When upgrading to v8.1.0 the environment variable will be ignored and only the repo based _auth key is used
Like this line: https://github.com/npm/cli/blob/v8.1.0/node_modules/npm-registry-fetch/auth.js#L81
Is it on purpose to ignore _auth for private repos and only use repo based e.g. //artifactory.company.com/artifactory/api/npm/npm/:_auth key?
Unfortunately i cannot provide this key using environment variable, because _ will be converted to -
However, when checking the user using npm whoami it resolves to the right user.
I think because of this: https://github.com/npm/cli/blob/release/v8.1.0/node_modules/%40npmcli/config/lib/index.js#L719
Expected Behavior
Be able to authorize private repository using npm_config__auth environment variable.
Steps To Reproduce
- Setup Private Repository
- Run
node:16-alpinecontainer - Provide Private Repository with
.npmrcfile (but no_authkey) - Provide
_authvianpm_config__authenvironment variable - Run
npm dist-tag add @scope/[email protected] feature
Environment
- OS: Alpine 3.13.6
- Node: 16.13.0
- npm: 8.1.0