Skip to content

Commit

Permalink
fix(perf): install nvm for ec2-user instead of root (#267)
Browse files Browse the repository at this point in the history
On root the nvm install script can not find a shell config.

```
=> Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zprofile, ~/.zshrc, and ~/.profile.
```
  • Loading branch information
mxinden authored Aug 21, 2023
1 parent 6fae3e5 commit 826444d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions perf/terraform/modules/long_lived/files/user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sudo systemctl start docker
sudo usermod -aG docker ec2-user

# Taken from https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
. ~/.nvm/nvm.sh
nvm install --lts
#
# Adapted to work with user-data according to https://repost.aws/questions/QUhS4f3j8jT6uW5OHAzi0-Wg/nodejs-not-installed-successfully-in-aws-ec2-inside-user-data
sudo -u ec2-user sh -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash'
sudo -u ec2-user sh -c '. ~/.nvm/nvm.sh && nvm install --lts'

0 comments on commit 826444d

Please sign in to comment.