cli icon indicating copy to clipboard operation
cli copied to clipboard

fix: npm exec does not use script-shell option to run commands

Open lux01 opened this issue 3 years ago • 1 comments

npm exec/npx do not fully respect the script-shell parameter. When combined with https://github.com/npm/run-script/issues/103 this means that users on AIX cannot run npx/npm exec commands even with script-shell set to bash.

For example:

$ npm config get script-shell
bash
$ npx

Entering npm script environment at location:
/home/gb120268/package/bin
Type 'exit' or ^D when finished

bash: --:  not found
$ npm config delete script-shell
$ ./npx

Entering npm script environment at location:
/home/gb120268/package/bin
Type 'exit' or ^D when finished

sh: --:  not found

References

Related to https://github.com/npm/run-script/issues/103

lux01 avatar Aug 11 '22 12:08 lux01

Ah yep, libnpmexec is pulling scriptShell out of flatOptions, but not passing it back through the chain to run-script

wraithgar avatar Aug 11 '22 13:08 wraithgar