There are various posts on the Xubuntu login loop, but none of them address NVM (Node Version Manager).

I have installed NodeJS via NVM on my Xubuntu VM and it works fine, however after rebooting, I can't log into Xfce anymore. Xubuntu is in a login loop.

The line responsible is in ~/.profile, added by NVM:

[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM

If I comment the line out, I can log in again.

I don't know exactly what the problem is. I suppose this line is failing somehow. How could I troubleshoot this? Are there any logs that I could look at?

If I log in through the terminal and run source ~./profile there are no errors and NVM is loaded correctly.

1 Answer 1


I posted your solution in NVM github, they have already a issue of this:



It seems that sh can't do dynamic substitution with variable, when loading profile.When execute with bash (terminal) it works.

So u could move this to your ~/.bashrc, also you can put this: source ~/.nvm/nvm.sh to your ~/.bashrc

I did the second and it works fine!

  • When writing an answer it is best to write the solution here then link to the source in case the linked site moves the page. Dec 29, 2013 at 17:19
  • @JulianStirling but they don't have an answer right now... It still an open issue
    – thur
    Dec 30, 2013 at 11:42
  • In which case this is not an answer. I know it is pedantic, but it is best give links to ongoing issues in comments, and answers in the answers section. Otherwise this is marked as having an answer when it doesn't. Dec 30, 2013 at 12:02
  • @JulianStirling ok! But I can't add a comment =/ I try this before put this answer.. but I don't have reputation ¬¬
    – thur
    Dec 30, 2013 at 12:18
  • Urg, that problem! Good point, there was nothing else you could do. Thanks for posting the link. Dec 30, 2013 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .