Created
March 5, 2016 21:21
-
-
Save alicraigmile/ae8f9ba5eda3958f5ed7 to your computer and use it in GitHub Desktop.
Script to install node.js locally on an RPi v3 so that jenkins doesn't need to be run as root to install node modules like libxmljs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# Script: node-localinstall-arm7.sh | |
# Install node.js locally on an RPi v3 so that jenkins doesn't | |
# need to be run as root to install node modules like libxmljs | |
# Author: Ali Craigmile <[email protected]> | |
# Licence: MIT | |
# Thanks: http://tnovelli.net/blog/blog.2011-08-27.node-npm-user-install.html | |
cd $HOME | |
curl -O https://nodejs.org/dist/v4.3.2/node-v4.3.2-linux-armv7l.tar.xz | |
tar xf node-v4.3.2-linux-armv7l.tar.xz | |
ln -s $HOME/node-v4.3.2-linux-armv7l/lib/node_modules $HOME/.node_modules | |
cat >> $HOME/.profile << EOT | |
# set PATH so it includes users private node.js bin if it exists | |
if [ -d "\$HOME/node-v4.3.2-linux-armv7l/bin" ] ; then | |
PATH="\$HOME/node-v4.3.2-linux-armv7l/bin:\$PATH" | |
fi | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment