My objective is to only install this npm package if it's not already available. This continues to to execute even when I've installed the module globally.
if [ npm list -g widdershins &> /dev/null ] || [ ! -d node_modules ]; then
npm install widdershins --no-shrinkwrap
fi
How can I adjust this to detect when it's installed globally?
if you want a one liner:
Local
npm list | grep widdershins || npm install widdershins --no-shrinkwrap
Global:
npm list -g | grep widdershins || npm install -g widdershins --no-shrinkwrap
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