Verify latest release
pnpm version
11.6.0
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/felipecrs/pnpm-repro-unsets-npm-config-env-vars
Reproduction steps
$ git clone https://github.com/felipecrs/pnpm-repro-unsets-npm-config-env-vars
$ cd pnpm-repro-unsets-npm-config-env-vars
$ npm_config_platform_arch=arm64 pnpm postinstall
Describe the Bug
The npm_config_ environment variables defined by the user gets unset by pnpm v11 during install scripts.
This makes it impossible to control the behavior of the install scripts that depend on it, like install-artifact-from-github (which is used by re2).
Apparently this is not the first time pnpm breaks it:
Specifically, this caused a regression in Renovate which prevents the release job from working after upgrading to pnpm v11:
renovatebot/renovate#43885 (comment)
The pnpm v11 changelog has this:
Lifecycle scripts no longer get npm_config_* env vars from the pnpm config; only well-known npm_* env vars are set, matching Yarn.
But that does not say it would unset variables set by the user, so I assume this is a bug.
Expected Behavior
If the environment variables are set by the user in the system, pnpm should not unset them.
Which Node.js version are you using?
v24.16.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
Ubuntu 26.04 LTS
Verify latest release
pnpm version
11.6.0
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/felipecrs/pnpm-repro-unsets-npm-config-env-vars
Reproduction steps
Describe the Bug
The
npm_config_environment variables defined by the user gets unset by pnpm v11 during install scripts.This makes it impossible to control the behavior of the install scripts that depend on it, like
install-artifact-from-github(which is used byre2).Apparently this is not the first time pnpm breaks it:
Specifically, this caused a regression in Renovate which prevents the release job from working after upgrading to pnpm v11:
renovatebot/renovate#43885 (comment)
The pnpm v11 changelog has this:
But that does not say it would unset variables set by the user, so I assume this is a bug.
Expected Behavior
If the environment variables are set by the user in the system, pnpm should not unset them.
Which Node.js version are you using?
v24.16.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
Ubuntu 26.04 LTS