.npmrc
environment variables override those in .env
files
#30298
Labels
.npmrc
environment variables override those in .env
files
#30298
Current Behavior
.npmrc
environment variables override those in.env
files described in the docs when nx is invokednpm run nx ...
ornpx nx ...
, but not when invoked directly.This behavior was observed using the
NODE_OPTIONS=--max-old-space-size=8192
variable.The docs suggest environment variables are overridden by those with the most specific scope. However an
.npmrc
file in any location: project, workspace root, external parent directories, or even the user's global.npmrc
, will override.env
variables.Expected Behavior
.npmrc
environment variables do not override those in.env
files when when nx is invokednpm run nx ...
ornpx nx ...
.If this cannot be fixed or is as-designed, I suggest adding a note in the docs to warn about this interaction. The cause is not obvious and is mistakable for a similar limitation of the
dotenv
package where theNODE_OPTIONS
variable cannot be set while node is running.GitHub Repo
https://github.com/tlaurie-cl/npmrc-overrides-nx-env
Steps to Reproduce
.env
).npmrc
).npmrc
)Nx Report
Package Manager Version
10.2.4
Operating System
The text was updated successfully, but these errors were encountered: