[BUG] "Unknown user/project config" warning about "email"
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
- With the latest Node.js 24 LTS and the latest npm.
- With
[email protected]in~/.npmrc. - Run 'npm --version`.
- 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
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!
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.
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,usernameand_passwordmust 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?