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.
Actual behavior:
${FOO} is not substituted
Additional information:
node -v prints: v20.3.0
- Windows, macOS, or Linux?: Linux, tested in latest
node container after installing pnpm via https://get.pnpm.io/install.sh
- The issue appears to be a missing implementation of key replacement in readLocalConfig.ts.
Any variables in
.npmrcthat occur left of the equals sign (i.e. in the key) are not substituted when reading the config. This behavior deviates fromnpmwhere they are substituted.Our specific use case is dynamically configuring the registry authorization:
The value
${TOKEN}is set as expected but the key is used as-is.pnpm version:
8.6.2
Code to reproduce the issue:
Expected behavior:
Variable
${FOO}is substituted with valuefooand used as key.Actual behavior:
${FOO}is not substitutedAdditional information:
node -vprints:v20.3.0nodecontainer after installingpnpmviahttps://get.pnpm.io/install.sh