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 { ...@@ -169,49 +169,58 @@ function install_nodejs {
return return
fi fi
if [ ! -f /usr/bin/nodejs ]; then if [ ! $ARCHITECTURE ]; then
# Note: this has to be jessie for now ARCHITECTURE=$(uname -m)
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
fi fi
rootdir=
mesh_install_nodejs
npm install -g npm@${NPM_VERSION} --save
npm install -g n@${NODEJS_N_VERSION} --save #if [ ! -f /usr/bin/nodejs ]; then
n ${NODEJS_VERSION} # Note: this has to be jessie for now
npm install -g pug@2.0.0-beta6 --save # wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key > /root/node.gpg.key
npm install -g graceful-fs@4.1.10 --save # apt-key add /root/node.gpg.key
npm install -g minimatch@3.0.3 --save # 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 npm install -g npm@${NPM_VERSION} --save
cp /usr/local/bin/node /usr/bin/nodejs #cp /usr/local/bin/node /usr/bin/nodejs
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 # node seems tricky so here we're going to double check
# that the versions we expect did get installed # 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