Fix nodejs image install

This commit is contained in:
Bob Mottram 2017-06-15 23:13:17 +01:00
parent eaa53b3bed
commit 86370db1d5
2 changed files with 51 additions and 48 deletions

View File

@ -1219,7 +1219,7 @@ function image_setup_utils {
function image_install_nodejs {
mesh_install_nodejs
echo 'install_nodejs' >> ${rootdir}/root/${PROJECT_NAME}-completed.txt
#echo 'install_nodejs' >> ${rootdir}/root/${PROJECT_NAME}-completed.txt
}
function image_preinstall_repos {

View File

@ -57,25 +57,26 @@ function mesh_install_nodejs {
exit 63962
fi
cat <<EOF > ${rootdir}/root/install-nodejs.sh
#!/bin/bash
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
EOF
chroot "${rootdir}" chmod +x /root/install-nodejs.sh
chroot "${rootdir}" /root/install-nodejs.sh
if [ ! "$?" = "0" ]; then
chroot "${rootdir}" rm -f /root/install-nodejs.sh
exit 7632572
fi
chroot "${rootdir}" rm -f /root/install-nodejs.sh
# TODO this doesn't work
# cat <<EOF > ${rootdir}/root/install-nodejs.sh
##!/bin/bash
#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
#EOF
# chroot "${rootdir}" chmod +x /root/install-nodejs.sh
# chroot "${rootdir}" /root/install-nodejs.sh
# if [ ! "$?" = "0" ]; then
# chroot "${rootdir}" rm -f /root/install-nodejs.sh
# exit 7632572
# fi
# chroot "${rootdir}" rm -f /root/install-nodejs.sh
}
function remove_nodejs {
@ -147,6 +148,7 @@ 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
@ -177,6 +179,7 @@ function install_nodejs {
echo $'nodejs was not installed'
exit 63962
fi
fi
npm install -g npm@${NPM_VERSION} --save
npm install -g n@${NODEJS_N_VERSION} --save