-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Environment Variables left of = equals sign are not substituted when reading .npmrc #6679
Copy link
Copy link
Closed
Labels
Description
Any variables in .npmrc that occur left of the equals sign (i.e. in the key) are not substituted when reading the config. This behavior deviates from npm where they are substituted.
Our specific use case is dynamically configuring the registry authorization:
# .npmrc
//${REGISTRY}:_authToken=${TOKEN}
The value ${TOKEN} is set as expected but the key is used as-is.
pnpm version:
8.6.2
Code to reproduce the issue:
echo "\${FOO}=\${BAR}" > .npmrc
FOO=foo BAR=bar pnpm config list
Expected behavior:
Variable ${FOO} is substituted with value foo and used as key.
foo=bar
Actual behavior:
${FOO} is not substituted
${FOO}=bar
Additional information:
node -vprints:v20.3.0- Windows, macOS, or Linux?: Linux, tested in latest
nodecontainer after installingpnpmviahttps://get.pnpm.io/install.sh - The issue appears to be a missing implementation of key replacement in readLocalConfig.ts.
Reactions are currently unavailable