Skip to content
Snippets Groups Projects
Commit 0871350f authored by Bob Mottram's avatar Bob Mottram
Browse files

Different way of installing nodejs

parent 14f8abf5
No related branches found
No related tags found
No related merge requests found
......@@ -169,49 +169,58 @@ function install_nodejs {
return
fi
if [ ! -f /usr/bin/nodejs ]; then
# Note: this has to be jessie for now
wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > /root/node.gpg.key
apt-key add /root/node.gpg.key
echo "deb https://deb.nodesource.com/node_6.x jessie main" > /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/node_6.x jessie main" >> /etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get -yq remove --purge nodejs
if [ -d /usr/local/lib/node_modules ]; then
rm -rf /usr/local/lib/node_modules
fi
if [ -f /usr/local/bin/node ]; then
rm /usr/local/bin/node
fi
if [ -f /usr/bin/node ]; then
rm /usr/bin/node
fi
if [ -f /usr/bin/nodejs ]; then
rm /usr/bin/nodejs
fi
apt-get -yq install nodejs
apt-get -yq install curl
if [ ! -f /usr/bin/nodejs ]; then
echo $'nodejs was not installed'
exit 63962
fi
if [ ! $ARCHITECTURE ]; then
ARCHITECTURE=$(uname -m)
fi
rootdir=
mesh_install_nodejs
npm install -g npm@${NPM_VERSION} --save
npm install -g n@${NODEJS_N_VERSION} --save
n ${NODEJS_VERSION}
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
#if [ ! -f /usr/bin/nodejs ]; then
# Note: this has to be jessie for now
# wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > /root/node.gpg.key
# apt-key add /root/node.gpg.key
# echo "deb https://deb.nodesource.com/node_6.x stretch main" > /etc/apt/sources.list.d/nodesource.list
# echo "deb-src https://deb.nodesource.com/node_6.x stretch main" >> /etc/apt/sources.list.d/nodesource.list
# apt-get update
# apt-get -yq remove --purge nodejs
# if [ -d /usr/local/lib/node_modules ]; then
# rm -rf /usr/local/lib/node_modules
# fi
# if [ -f /usr/local/bin/node ]; then
# rm /usr/local/bin/node
# fi
# if [ -f /usr/bin/node ]; then
# rm /usr/bin/node
# fi
# if [ -f /usr/bin/nodejs ]; then
# rm /usr/bin/nodejs
# fi
# apt-get -yq install nodejs
# apt-get -yq install curl
# if [ ! -f /usr/bin/nodejs ]; then
# echo $'nodejs was not installed'
# exit 63962
# fi
#fi
#npm install -g npm@${NPM_VERSION} --save
#npm install -g n@${NODEJS_N_VERSION} --save
#n ${NODEJS_VERSION}
#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
npm install -g npm@${NPM_VERSION} --save
cp /usr/local/bin/node /usr/bin/nodejs
cp /usr/local/bin/npm /usr/bin/npm
#cp /usr/local/bin/node /usr/bin/nodejs
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment