cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] "Unknown user/project config" warning about "email"

Open prantlf opened this issue 1 month ago • 3 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

This issue exists in the latest npm version

  • [x] I am using the latest npm

Current Behavior

npm prints the following warning on the console:

npm warn Unknown user config "email". This will stop working in the next major version of npm.

The "email" property is documented. npm shouldn't complain about it.

There's another similar issue #8153, but it's about custom properties in .npmrc.

Expected Behavior

No warning about the "email" property.

Steps To Reproduce

  1. With the latest Node.js 24 LTS and the latest npm.
  2. With [email protected] in ~/.npmrc.
  3. Run 'npm --version`.
  4. See the warning appear.
❯ npm --version --verbose
npm verbose cli /Users/prantlf/.nodeup/24.11.0/bin/node /Users/prantlf/.node/bin/npm
npm info using [email protected]
npm info using [email protected]
npm warn Unknown user config "email". This will stop working in the next major version of npm.
11.6.2
npm verbose cwd /home/prantlf
npm verbose os Darwin 24.6.0
npm verbose node v24.11.0
npm verbose npm  v11.6.2
npm verbose exit 0
npm info ok

❯ node --version
v24.11.0

❯ echo $NODE_OPTIONS

Environment

  • npm: 11.6.2
  • Node.js: 24.11.0
  • OS Name: MacOS 15.7.1
  • System Model Name: MacBook Pro 2018
  • npm config:
//registry.npmjs.org/:_authToken=...
[email protected]

init-author-name=Ferdinand Prantl
[email protected]

save-prefix=^
package-lock=true
audit=true

prantlf avatar Nov 01 '25 14:11 prantlf

Hello, I’ve worked on this issue and made the necessary changes to definitions.js to add legacy support for email and username config keys. I’ve also updated the snapshots so tests pass locally. I also noticed the same error being displayed with username as well.

This is my first contribution, so please let me know if there’s anything I should adjust or improve. Happy to make changes!

Sarang-Patel avatar Nov 02 '25 20:11 Sarang-Patel

The docs are a little vague here, all of these entries must be scoped to a registry. The docs should probably not list a partial list then a full list, giving the impression that only those first ones must be scoped.

wraithgar avatar Nov 02 '25 21:11 wraithgar

The docs are a little vague here, all of these entries must be scoped to a registry. The docs should probably not list a partial list then a full list, giving the impression that only those first ones must be scoped.

Actually, the documentation is specific about this:

The settings _auth, _authToken, username and _password must all be scoped to a specific registry.

I have always included the email value with no scope. Wouldn't forcing it scoped now be a breaking change? Wasn't the email meant to be shared among multiple registries?

prantlf avatar Nov 03 '25 00:11 prantlf