-
-
Save evanharmon/9a7290b451475df15022631dc3ca84f1 to your computer and use it in GitHub Desktop.
Install NVM via ec2 userdata
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
| cat > /tmp/subscript.sh << EOF | |
| # START UBUNTU USERSPACE | |
| echo "Setting up NodeJS Environment" | |
| curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash | |
| echo 'export NVM_DIR="/home/ubuntu/.nvm"' >> /home/ubuntu/.bashrc | |
| echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.bashrc | |
| # Dot source the files to ensure that variables are available within the current shell | |
| . /home/ubuntu/.nvm/nvm.sh | |
| . /home/ubuntu/.profile | |
| . /home/ubuntu/.bashrc | |
| # Install NVM, NPM, Node.JS & Grunt | |
| nvm alias default 4.4.4 | |
| nvm install 4.4.4 | |
| nvm use 4.4.4 | |
| EOF | |
| chown ubuntu:ubuntu /tmp/subscript.sh && chmod a+x /tmp/subscript.sh | |
| sleep 1; su - ubuntu -c "/tmp/subscript.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment