I'm trying to npm install a package in Ubuntu 16.04. I get the following error message:
npm install
...
> [email protected] bower-install /home/kent/Documents/padlock
> pushd app && bower install && popd app
sh: 1: pushd: not found
According to /bin/sh: pushd: not found, my problem is clearly that npm install is trying to execute pushd with sh not bash.
However, my default shell is already bash
$ env | grep SHELL
SHELL=/bin/bash
$ echo $SHELL
/bin/bash
$ echo $0
bash
and I'm not sure what I need to change. I've also tried adding SHELL=/bin/bash before I execute pushd app but I have had no luck with that either.
npm-scripts run using sh
Scripts are run by passing the line as a script argument to sh
https://docs.npmjs.com/misc/scripts#exiting
If you want to use bash for your scripts make the script
bash -c 'pushd app && bower install && popd'
Update: As of November 2017 you can now set script-shell in .npmrc to use a custom shell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With