Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Trying to set the prefix
config option using environment variables as documented here:
https://docs.npmjs.com/cli/v8/using-npm/config#environment-variables
The current behaviour is that the output from these two commands is different.
NPM_CONFIG_PREFIX=dingle npm config ls -l | grep prefix
npm --prefix dingle config ls -l | grep prefix
In addition, currently this command:
NPM_CONFIG_PREFIX=dingle npm install doodle.css
does not install into the folder dingle
whereas this command does:
npm install --prefix dingle doodle.css
Expected Behavior
Expected behaviour setting the prefix
via either NPM_CONFIG_PREFIX
or --prefix
has the same results and installs into the specified folder.
Steps To Reproduce
$ npm --version
->8.1.2
- Run
NPM_CONFIG_PREFIX=dingle npm config ls -l | grep prefix
andnpm --prefix dingle config ls -l | grep prefix
- Observe the output is different
Environment
- npm: 8.1.2
- Node.js: v16.13.1
- OS Name: Ubuntu Linux
- System Model Name: Dell XPS 13
- npm config:
; "user" config from /home/chrism/.npmrc
//registry.npmjs.org/:_authToken = (protected)
unsafe-perm = true
; node bin location = /home/chrism/.nvm/versions/node/v16.13.1/bin/node
; cwd = /home/chrism/dev/npm-prefix-test
; HOME = /home/chrism
; Run `npm config ls -l` to show all defaults.