The release of npm 5.1.0 introduced the ability to set a different shell for running package.json scripts, so I thought a cool idea would be to do:
npm config set script-shell node_modules/.bin/shx…
But for some reason it doesn't work and I'm not sure why?
> npm test
Error: Missing ShellJS command name
shx: A wrapper for shelljs UNIX commands.
Usage: shx <command> [options]
Example:
$ shx ls .
foo.txt
bar.txt
baz.js
$ shx rm -rf *.txt
$ shx ls .
baz.js
Commands:
- cat
- chmod
- cp
- echo
- tempdir
- pwd
- ls
- find
- grep
- head
- ln
- mkdir
- rm
- mv
- sed
- sort
- tail
- test
- touch
- uniq
- which
- error
- help
npm ERR! Test failed. See above for more details.
If this worked I could finally [almost] pretend Windows doesn't exist as far as npm scripts are concerned, without even having to prefix every script command with shx, yet still support those unfortunate users…
The release of npm 5.1.0 introduced the ability to set a different shell for running package.json
scripts
, so I thought a cool idea would be to do:npm config set script-shell node_modules/.bin/shx
…But for some reason it doesn't work and I'm not sure why?
If this worked I could finally [almost] pretend Windows doesn't exist as far as npm
scripts
are concerned, without even having to prefix every script command withshx
, yet still support those unfortunate users…