Extra npm checks

This commit is contained in:
Bob Mottram 2017-06-04 15:38:50 +01:00
parent 3257c8658f
commit f4137c28d1
1 changed files with 16 additions and 6 deletions

View File

@ -125,9 +125,13 @@ function upgrade_nodejs {
n {NODEJS_VERSION}
fi
cp /usr/local/bin/n /usr/bin/n
cp /usr/local/bin/npm /usr/bin/npm
cp /usr/local/bin/node /usr/bin/nodejs
cp /usr/local/bin/node /usr/bin/node
if [ -f /usr/local/bin/npm ]; then
cp /usr/local/bin/npm /usr/bin/npm
fi
if [ -f /usr/local/bin/node ]; then
cp /usr/local/bin/node /usr/bin/nodejs
cp /usr/local/bin/node /usr/bin/node
fi
}
function install_nodejs {
@ -174,9 +178,13 @@ function install_nodejs {
fi
npm install -g npm@${NPM_VERSION} --save
if [ ! -f /usr/local/bin/npm ]; then
exit 3
if [ ! -f /usr/bin/npm ]; then
exit 3
fi
fi
if [ -f /usr/local/bin/npm ]; then
cp /usr/local/bin/npm /usr/bin/npm
fi
cp /usr/local/bin/npm /usr/bin/npm
npm install -g pug@2.0.0-beta6 --save
npm install -g graceful-fs@4.1.10 --save
npm install -g minimatch@3.0.3 --save
@ -189,7 +197,9 @@ function install_nodejs {
rm -rf /usr/local/lib/node_modules/npm
fi
npm install -g npm@${NPM_VERSION} --save
cp /usr/local/bin/npm /usr/bin/npm
if [ -f /usr/local/bin/npm ]; then
cp /usr/local/bin/npm /usr/bin/npm
fi
# node seems tricky so here we're going to double check
# that the versions we expect did get installed