-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
"Unknown user/project config" warnings starting in npm 11.2.0 #8153
Comments
This also applies to things like NODE_OPTIONS and any options that are set for pnpm or other package managers that use .npmrc |
This comment has been minimized.
This comment has been minimized.
On my end: |
I believe the intention is to stop people from doing exactly that - from abusing npmrc as a way to define non-npm-related environment or configuration variables. |
We have the same warnings with cli and env config: npm run myScript --customVar
Will there be a way to whitelist some keys? |
My understanding is that only things npm uses will be supported. If you want to pass arguments to the script’s command itself, use |
That will pass arguments only to the last command in case the script is defined like: "myScript": "command1 && command2" Is there an easy way to pass parameters to both commands in this case? |
an environment variable, i suppose? |
Why is this viewed as "abuse"? The
@ljharb, your suggestion of a workaround, an environmental variable, is actually the exact case that has been broken without explanation. @wraithgar, since you shipped this change, can you confirm if this is intended behavior? I think if |
The ~/D/s/glob $ npm pkg get config
{
"foo": "hello world"
}
~/D/s/glob $ npm config ls|grep foo
~/D/s/glob $ npm run env|grep foo
npm_package_config_foo=hello world
~/D/s/glob $ npm -v
11.2.0 No warnings. |
These should be unaffected. In |
I am going to pin this issue for now since there may be more folks who are wondering how to address these warnings. I also added a link to the OP to my comment about |
I get this warning even after deleting all
Is this a Debian thing? I installed |
@Rudxain npm comes with node and shouldn't be installed separately, and node in the debian repos is broken - if you must use apt, use the nodesource repos. As for that warning, do you have a |
Oh ok. I was considering installing the latest straight from https://nodejs.org anyways. Even Debian-Testing (my install) has an outdated LTS (v20 with "back-ports") Note Not to diss deb maintainers. I feel thankful that other packs are cutting-edge! I just find it weird that Node seems so old
env | grep -i NPM
# no match |
---Added by npm team---
Summary
When running
npm --version
, npm issues warnings about some custom configuration keys in my.npmrc
. These warnings indicate that the keys will stop working in the next major version of npm.Environment
Steps to Reproduce
Create a
.npmrc
file with the following content:Run the command:
Observe the following warnings:
Expected Behavior
The custom configuration keys should be recognized, or there should be documentation clarifying the correct way to set these options without triggering warnings.
Actual Behavior
The custom keys (
electron_mirror
,electron_custom_dir
, andelectron_builder_binaries_mirror
) are not recognized by npm, resulting in warning messages about their future deprecation.Questions
Additional Context
I am using custom mirror URLs to optimize package and binary downloads. Any guidance or documentation regarding the proper configuration for these settings would be greatly appreciated.
The text was updated successfully, but these errors were encountered: