Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/ ] && . $HOME/.nvm/ # 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.

share|improve this question

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 u can put this: source ~/.nvm/ to your ~\.bashrc

I make the second and works fine!

share|improve this answer
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. – Julian Stirling Dec 29 '13 at 17:19
@JulianStirling but they don't have an answer right now... It still an open issue – thur Dec 30 '13 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. – Julian Stirling Dec 30 '13 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 '13 at 12:18
Urg, that problem! Good point, there was nothing else you could do. Thanks for posting the link. – Julian Stirling Dec 30 '13 at 12:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.