nvm: nvm command not found

When i run:

sudo -u vagrant -H bash -l -c 'nvm install v0.10.32'

on a ubuntu 14.04 box i get this error:

bash: nvm: command not found

This error wasn’t showing up some weeks ago.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Now it works… Apparently i need to have these lines

export NVM_DIR=~/.nvm
[ -s "~/.nvm/nvm.sh" ] && . "~/.nvm/nvm.sh"

on my .profile for the command to work.

k, i had to ask 😃 Since then, however, the install script has changed. Per #394, can you try manually adding/ensuring these lines to your .bashrc:

export NVM_DIR=~/.nvm
[ -s "~/.nvm/nvm.sh" ] && . "~/.nvm/nvm.sh"

Alternatively, if you rerun the install script via curl, it should do that for you as well.