diff --git a/src/freedombone-app-scuttlebot b/src/freedombone-app-scuttlebot index fc08ebaf..8d1f7aa4 100755 --- a/src/freedombone-app-scuttlebot +++ b/src/freedombone-app-scuttlebot @@ -357,24 +357,6 @@ function scuttlebot_git_setup { fi } -function mesh_setup_npm { - cat < "$rootdir/usr/bin/install_npm_global" -#!/bin/bash -if [ ! -d ~/.npm-global ]; then - mkdir ~/.npm-global -fi -npm config set prefix '~/.npm-global' -if [[ "$PATH" != *'~/.npm-global/bin'* ]]; then - export PATH=~/.npm-global/bin:$PATH - echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc -fi -source ~/.profile -EOF - chroot "$rootdir" /bin/chmod +x /usr/bin/install_npm_global - chroot "$rootdir" /usr/bin/install_npm_global - rm "$rootdir/usr/bin/install_npm_global" -} - function mesh_install_dat { get_npm_arch mesh_setup_npm @@ -402,6 +384,9 @@ function mesh_install_scuttlebot { cat < "$rootdir/usr/bin/install_scuttlebot" #!/bin/bash +export PATH=~/.npm-global/bin:$PATH +export NPM_CONFIG_PREFIX=~/.npm-global +source ~/.profile if ! npm install --unsafe-perm --verbose --arch=$NPM_ARCH -g scuttlebot@${SCUTTLEBOT_VERSION}; then exit 1 fi diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index 9d4b5aee..1285f109 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -244,6 +244,25 @@ function nodejs_upgrade { npm update -g } +function mesh_setup_npm { + cat < "$rootdir/usr/bin/install_npm_global" +#!/bin/bash +if [ ! -d ~/.npm-global ]; then + mkdir ~/.npm-global +fi +npm config set prefix '~/.npm-global' +if [[ "$PATH" != *'~/.npm-global/bin'* ]]; then + export PATH=~/.npm-global/bin:$PATH + echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc +fi +export NPM_CONFIG_PREFIX=~/.npm-global +source ~/.profile +EOF + chroot "$rootdir" /bin/chmod +x /usr/bin/install_npm_global + chroot "$rootdir" /usr/bin/install_npm_global + rm "$rootdir/usr/bin/install_npm_global" +} + function nodejs_setup_global_modules { if [ ! -f /usr/local/bin/node ]; then return