-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Description
Version
22
Platform
Windows
Subsystem
No response
What steps will reproduce the bug?
This is related to recently added feature #52190
1
Define package with package.json script that is executable in POSIX shell, but it is not executable/portable on cmd.exe.
2
Set script-shell configuration option in .npmrc in your package folder to "bash" (or "sh") to allow cross-platform execution of the script (Scripts will be cross platform as long as the target Windows machine has essential UNIX tools support, e.g. WSL or MSYS/Cygiwn installed).
2
Add a script with the following code or similar: NODE_OPTIONS='--max-old-space-size=8192' ./node_modules/jest/bin/jest
4
Run the script using "npm run", "pnpm run" on Windows system with "bash" available. Will work ok.
Run the script using "node --run". Script will fail with 'NODE_OPTIONS' is not recognized as an internal or external command, operable program or batch file.
How often does it reproduce? Is there a required condition?
N/A
What is the expected behavior? Why is that the expected behavior?
Node --run should work consistently with npm run, pnpm run, etc., in regards to which shell is used to run scripts.
What do you see instead?
See above - Scripts are always executed in default system shell, disregarding .npmrc script-shell option.
Additional information
No response