Skip to content

npm warn Unknown env config with npm 11.2.0 create friction. #8353

@garronej

Description

@garronej

Hello NPM team,

Since NPM CLI version 11.2, I'm experiencing notable friction as a devtool and CLI maintainer caused by new warnings related to unrecognized environment configs set by other package managers (e.g., pnpm, Yarn).

Specifically, I'm referring to warnings such as:

npm warn Unknown env config "version-git-tag". This will stop working in the next major version of npm.
npm warn Unknown env config "argv". This will stop working in the next major version of npm.
npm warn Unknown env config "version-commit-hooks". This will stop working in the next major version of npm.
npm warn Unknown env config "version-git-message". This will stop working in the next major version of npm.
npm warn Unknown env config "version-tag-prefix". This will stop working in the next major version of npm.

Why this matters:

Previously, I could confidently write my CLI tools and technical documentation assuming that, regardless of the package manager that my user are using to initiate the execution of the script (example pnpm run <srcipt> or pnpm exec <bin name>):

npx <bin name>
npm run <script>
npm config get

This always provided consistent, reliable results independent of how users actually initiated the execution of my CLI.

Concrete example:

Consider this starter repo where the package.json defines:

"scripts": {
  "build": "tsc -b && vite build",
  "build-keycloak-theme": "npm run build && keycloakify build"
}

When users follow these straightforward instructions:

git clone https://github.com/keycloakify/keycloakify-starter
cd keycloakify-starter
npm install
npm run build-keycloak-theme

Everything works flawlessly, no warnings.

However, if users choose a different package manager like pnpm, executing:

pnpm run build-keycloak-theme

now triggers multiple warnings due to environment variables that pnpm sets internally.

Impact on maintainers and users:

As a maintainer, I face substantial friction. To avoid confusing warnings for users, I must either instruct them explicitly to modify scripts per package manager (e.g., replacing npm run with pnpm run).

Additionally for the NPM command that I ran in my CLIs I must now make sure to swallow all thoses warnings so that they are not surfaced to the user.

Currently, every command invocation floods terminals with irrelevant warnings like this:

Image

Suggested approach:

I fully understand these warnings are not strictly bugs; however, given NPM's unique position as the default package manager present in nearly every Node.js setup, it's incredibly beneficial to rely on NPM commands consistently across user environments, even those that manage dependencies with other package managers.

Could these warnings perhaps be reconsidered?

Thank you sincerely for considering this feedback, and thanks as always for your work maintaining NPM!

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions