[BUG] npm run ignores INIT_CWD #3575
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 7.x
work is associated with a specific npm 7 release
Is there an existing issue for this?
Current Behavior
INIT_CWD
is ignored by npm run command.Expected Behavior
As it follows from the
npm run
help page (assuming it's still relevant):[...] If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run. [...] [0]
Steps To Reproduce
Run the following in zsh/bash.
What it does:
/tmp/test-npm-cwd
subdir withpackage.json
$ npm run echo
from the parental/tmp
withINIT_CWD
set up totmp/test-npm-cwd
The output:
Environment
The text was updated successfully, but these errors were encountered: