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.
I posted your solution in NVM github, they have already a issue of this:
https://github.com/creationix/nvm/issues/334
EDITED:
It seems that
sh
can't do dynamic substitution with variable, when loading profile.When execute withbash
(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!