Test for npm before brew install

This commit is contained in:
Gene Hoffman
2020-04-08 11:58:17 -07:00
parent 832a118261
commit ca82caef42
+3 -2
View File
@@ -35,11 +35,12 @@ if [ `uname` = "Linux" ]; then
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install -y nodejs
fi
elif [ `uname` = "Darwin" ] && type brew; then
elif [ `uname` = "Darwin" ] && type brew && ! npm version>/dev/null 2>&1; then
# Install npm if not installed
brew install npm
elif [ `uname` = "Darwin" ] && ! type brew; then
echo "Installation requires brew on MacOS"
echo "Installation currently requires brew on MacOS"
echo "Instructions here: https://brew.sh/"
fi
# this fancy syntax sets INSTALL_PYTHON_PATH to "python3.7" unless INSTALL_PYTHON_VERSION is defined