I just fired up a new EC2 instance on Amazon and I'm trying to install nvm. I tried running their install script with the NVM_DIR=... for a global install:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | NVM_DIR=/usr/local/nvm bash
but I get this error:
=> Downloading nvm from git to '/usr/local/nvm' => mkdir: cannot create directory ‘/usr/local/nvm’: Permission denied
I get this error with sudo as well. I also tried going into usr/local and making the nvm directory manually, but then i get other errors like this:
=> Cloning into '/usr/local/nvm'... /usr/local/nvm/.git: Permission denied
Does anyone know why this is happening? Is it a permissions thing on aws I am unfamiliar with?
Edit: using a much older version without the NVM_DIR stuff worked. I still want global access though, so this does not solve the problem
curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh