-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INIT_CWD does not get reset if npm install
is invoked by another npm script
#2578
Comments
Hm, yes, it appears that I misread the npm v6 behavior. |
This should always be set to the npm cwd, even if already in the env. Fix: npm/cli#2578
This should always be set to the npm cwd, even if already in the env. Fix: npm/cli#2578
* Restore npm v6 behavior with INIT_CWD This should always be set to the npm cwd, even if already in the env. Fix: npm/cli#2578 * Do not set the PREFIX environment variable Fix: npm/cli#2398
How is INIT_CWD accessed now? I used it in my scripts on Windows like this, which always worked in version 6, but now doesn't anymore:
I am using npm v7.5.3 |
If your shell is bash for windows:
But you shouldn't need that, just use "./src..." |
Thanks @jsg2021 for the fast response. You are obviously right that the easiest solution would be to use Using However, I finally found a workaround using
|
Originally posted by @isaacs in #2033 (comment)
This is maybe more of a question. But I was surprised by the fact INIT_CWD retained the parent process's value when a post-install script installed a child-directory project...
The text was updated successfully, but these errors were encountered: