Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install on Ubuntu 13.10 causes login loop #346

Closed
guifromrio opened this issue Jan 5, 2014 · 8 comments
Closed

Install on Ubuntu 13.10 causes login loop #346

guifromrio opened this issue Jan 5, 2014 · 8 comments

Comments

@guifromrio
Copy link

After installing NVM via the script, it automatically adds the following line to ~/.profile

[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh

This causes a login loop on any distro based on Ubuntu 13.10.

Logging into a different tty and deleting this line from ~/.profile solves the issue and allows login as usual.

Furthermore, .profile is not sourced by default, so Ubuntu users must copy this instruction to .bashrc.

If we move it there, there will be no more problems. What do you think?

@konklone
Copy link

konklone commented Jan 6, 2014

I had this problem today, and the underlying problem (as found in .xsession-errors) was:

/usr/sbin/lightdm-session: 24: /home/eric/.nvm/nvm.sh: Bad substitution
/usr/sbin/lightdm-session: 504: /home/eric/.nvm/nvm.sh: Syntax error: "(" unexpected (expecting ";;")

Line 24 is:

export NVM_DIR=$(cd $NVM_CD_FLAGS $(dirname ${BASH_SOURCE[0]:-$0}) > /dev/null && pwd)

Line 504 is:

INSTALLS=( `nvm use $VERSION > /dev/null && npm -g -p ll | \grep "$ROOT\/[^/]\+$" | cut -d '/' -f $(($ROOTDEPTH + 2)) | cut -d ":" -f 2 | \grep -v npm | tr "\n" " "` )

@Gadr, are you sure .profile is not sourced by default? It's clearly read by something, or it wouldn't have affected our login process.

@guifromrio
Copy link
Author

Sorry, I was not precise.
It must be, indeed, sourced somewhere for it to cause the problem.
It is not, however, sourced when opening new terminals or new terminal tabs on the default Ubuntu terminal.
Therefore, after installing NVM, there is no nvm command on the path. I had to add it to .bashrc.

Nice investigation, BTW.
But my bash-fu isn't enough to solve these problems...

@konklone
Copy link

konklone commented Jan 6, 2014

In other words, for Ubuntu users, using .profile is all potential downside, and no upside.

One approach might to be detect if .bashrc or .bash_profile exists, then put the line there instead of .profile.

Either way, the underlying bug should be fixed, but this would at least limit how catastrophic a syntax bug can be.

@guifromrio
Copy link
Author

Precisely.

On Mon, Jan 6, 2014 at 3:15 PM, Eric Mill notifications@github.com wrote:

In other words, for Ubuntu users, using .profile is all potential
downside, and no upside.

One approach might to be detect if .bashrc or .bash_profile exists, then
put the line there instead of .profile.

Either way, the underlying bug should be fixed, but this would at least
limit how catastrophic a syntax bug can be.


Reply to this email directly or view it on GitHubhttps://github.com//issues/346#issuecomment-31666332
.

@bengentil
Copy link

I had the same issue. the NVM line was in .bash_profile.

Ubuntu use dash as default shell so i've changed the shebang line to #!/bin/bash in .nvm/nvm.sh
now everything is working again

@dolmen
Copy link
Contributor

dolmen commented Jan 12, 2014

@bengentil Changing the shebang of nvm.sh doesn't have any effect because nvm.sh is sourced in the current shell.

@ljharb ljharb closed this as completed in 60e66fa Jan 15, 2014
ljharb added a commit that referenced this issue Jan 15, 2014
@konklone
Copy link

That's great, thank you!

@guifromrio
Copy link
Author

Thanks! Cheers!

On Wed, Jan 15, 2014 at 4:48 AM, Eric Mill notifications@github.com wrote:

That's great, thank you!


Reply to this email directly or view it on GitHubhttps://github.com//issues/346#issuecomment-32338632
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants