diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 7ce08c18..8c799ac6 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -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 { diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index 64681a74..368756fb 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -57,25 +57,26 @@ function mesh_install_nodejs { exit 63962 fi - cat < ${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 < ${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,35 +148,37 @@ function install_nodejs { return fi - # 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_7.x jessie main" > /etc/apt/sources.list.d/nodesource.list - echo "deb-src https://deb.nodesource.com/node_7.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 + # 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_7.x jessie main" > /etc/apt/sources.list.d/nodesource.list + echo "deb-src https://deb.nodesource.com/node_7.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 npm install -g npm@${NPM_VERSION} --save