diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index ed109acf..c40cbd05 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -74,28 +74,26 @@ function mesh_install_nodejs { exit 7235728 fi - if [ -f /usr/share/npm/bin/npm-cli.js ]; then - ln -s /usr/share/npm/bin/npm-cli.js /usr/bin/npm - else - wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh - if [ ! -f $rootdir/root/npm_install.sh ]; then - echo $'Unable to download npm installer' - exit 8793636 - fi - chroot "$rootdir" chmod +x /root/npm_install.sh - sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh - chroot "$rootdir" /root/npm_install.sh + wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh + if [ ! -f $rootdir/root/npm_install.sh ]; then + echo $'Unable to download npm installer' + exit 8793636 fi + chroot "$rootdir" chmod +x /root/npm_install.sh + sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh + chroot "$rootdir" /root/npm_install.sh + if [ ! -f $rootdir/usr/bin/npm ]; then echo $'npm was not installed' exit 5290462 fi + cp $rootdir/usr/bin/npm $rootdir/root/npm # update from the old debian nodejs version get_npm_arch chroot "$rootdir" npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save chroot "$rootdir" n --arch $N_ARCH ${NODEJS_VERSION} - chroot "$rootdir" npm install -g --arch $NPM_ARCH npm@${NPM_VERSION} --save + cp $rootdir/root/npm $rootdir/usr/bin/npm } function remove_nodejs {