just use nvm install to install and activate correct version

This commit is contained in:
spalger
2016-05-19 06:33:17 -07:00
parent 290b682c95
commit 531f57b004

View File

@ -41,15 +41,8 @@ function install_node {
ulimit -c unlimited
fi
nvm use "$version"
NVM_USE_CODE=$?
if [[ $NVM_USE_CODE -gt 0 ]]; then
# nvm use failed
echo "installing node $version";
crit nvm install "$version";
# fresh installs should include npm, but lets check anyway
fi
echo "installing node $version";
crit nvm install "$version"
if [[ "$(which npm)" == "" ]]; then
echo "npm is missing, reinstalling node version $version";