Coder Social home page Coder Social logo

Comments (10)

mdgrech avatar mdgrech commented on September 24, 2024

Man I had the same happen to me. The src folder and my versions of node are all showing up in my home folder rather than under ~/.nvm what gives?

from nvm.

sheldonkwok avatar sheldonkwok commented on September 24, 2024

Not to be a necromancer but has anyone figured out why this is happening?

from nvm.

 avatar commented on September 24, 2024

@sheldonkwok I don't know much about bash at the moment so I'm not sure why this happens, but the $NVM_DIR variable in ~/.nvm/nvm.sh is always set to the home directory, so when it gets to the [ ! -d "$NVM_DIR" ] check it just skips over it.

I fixed it simply by removing the [ ! -d "$NVM_DIR" ] check on line 18 of the nvm.sh file.

from nvm.

nicholascloud avatar nicholascloud commented on September 24, 2024

I forced NVM_DIR to be correct in my .bash_profile before I source NVM:

# nvm
NVM_DIR=~/.nvm; export NVM_DIR
. ~/.nvm/nvm.sh
[[ -r $NVM_DIR/bash_completion ]] && . $NVM_DIR/bash_completion

from nvm.

davidbarton avatar davidbarton commented on September 24, 2024

@nicholascloud works for me, thanks a lot.

from nvm.

simov avatar simov commented on September 24, 2024

I removed the check on line 18 like @jakelucas pointed out, it's not the best solution but it worked for me.

from nvm.

juriejan avatar juriejan commented on September 24, 2024

I also had the same problem, but it's the first time in a year of using NVM that I've encountered it.

It seems that for some reason NVM_DIR was defined as my home directory, but after restarting it was gone. I couldn't determine any obvious reason for it being set.

I've not been able to replicate the issue. Anyone have an idea of how I could replicate it?

from nvm.

dolivier avatar dolivier commented on September 24, 2024

I also got this issue. I presumed that BASH_SOURCE[0] didn't evaluate correctly within the context of the login.
This is a duplicate of #268 (BASH_SOURCE makes no sense to dash, which is the shell that reads ~/.profile, and which sources nvm.sh)

from nvm.

ljharb avatar ljharb commented on September 24, 2024

Is this still a problem with v0.5.1 of nvm?

from nvm.

ljharb avatar ljharb commented on September 24, 2024

Please reopen if this is still an issue in the latest tagged release (currently v0.10.0)

from nvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.