Skip to content

Instantly share code, notes, and snippets.

@ogckw
Last active July 15, 2021 20:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ogckw/0e057fc0367a04006c5f6323bf26fb33 to your computer and use it in GitHub Desktop.
Save ogckw/0e057fc0367a04006c5f6323bf26fb33 to your computer and use it in GitHub Desktop.
ec2-amazon-linux-node-userdata
#!/bin/bash
# Program:
# EC2 initially install node.js, git for development environment.
# You can modify nodev and nvmv for changing node and nvm version.
# Set permission to ec2-user install above.
# History:
# 2017/07/25 Hans First release
home=/home/ec2-user
nodev='8.11.2'
nvmv='0.33.11'
su - ec2-user -c "curl https://raw.githubusercontent.com/creationix/nvm/v${nvmv}/install.sh | bash"
su - ec2-user -c "nvm install ${nodev}"
su - ec2-user -c "nvm use ${nodev}"
# install git
yum install git -y
# option initial git for codecommit if want to use please uncomment it
# git config --system credential.helper '!aws codecommit credential-helper $@'
# git config --system credential.UseHttpPath true
@matwerber1
Copy link

I have spent the last 8 hours trying to figure out the above. It was driving me crazy. So happy you made this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment