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 does not work on Mac (capitan) #889

Closed
mesozoic-technology opened this issue Nov 2, 2015 · 9 comments
Closed

Install does not work on Mac (capitan) #889

mesozoic-technology opened this issue Nov 2, 2015 · 9 comments
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS

Comments

@mesozoic-technology
Copy link

I installed both with curl & with git clone, and the command nvm does not work for me. After including . ~/.nvm/nvm.sh in my .bashrc.

Is there something different about the new mac os ?

@ljharb
Copy link
Member

ljharb commented Nov 2, 2015

Is it a fresh install? I assume you're using the stock bash. Do you have a ~/.bash_profile file? If that's present, I think OS X doesn't source ~/.bashrc.

@ljharb ljharb added the needs followup We need some info or action from whoever filed this issue/PR. label Nov 2, 2015
@ljharb
Copy link
Member

ljharb commented Nov 2, 2015

@realisation Also, please try . $NVM_DIR/nvm.sh on the command line, and confirm that nvm does at least work properly when sourced!

@shri3k
Copy link

shri3k commented Nov 9, 2015

please try . $NVM_DIR/nvm.sh on the command line, and confirm that nvm does at least work properly when sourced!

@ljharb That does indeed work. However, I did have the ~/.bash_profile but it didn't include the script in there when I curled it.

@ljharb
Copy link
Member

ljharb commented Nov 9, 2015

OK - this is just an issue with the install script then. To fix for your case, manually add these two lines in the last section of https://github.com/creationix/nvm#manual-install

@ljharb ljharb added OS: Mac OS installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. labels Nov 9, 2015
@license2e
Copy link

@ljharb re: Do you have a ~/.bash_profile file? If that's present, I think OS X doesn't source ~/.bashrc.

That worked! Thank you!!

Steps to fix:

  1. open ~/.bashrc and cut the lines that add nvm.sh to the $PATH
  2. create the file bash_profile: touch ~/.bash_profile
  3. open that file in your favorite editor, and paste in the cut lines
  4. restart terminal

@simonh1000
Copy link

What is the final recommendation for this:

  • i have no .bashrc and in .bash_profile I have
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

but this is not enough to get to use node and npm

@ljharb
Copy link
Member

ljharb commented Nov 27, 2015

@simonh1000 nvm alias default node if you want a version auto-used on shell startup. By default, you always have to nvm use something every time you open a new shell.

@simonh1000
Copy link

@ljharb thansk so much - I must have done that months ago on the old machine and forgotten about it

@ljharb
Copy link
Member

ljharb commented Jun 25, 2016

This appears resolved?

@ljharb ljharb closed this as completed Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. needs followup We need some info or action from whoever filed this issue/PR. OS: Mac OS
Projects
None yet
Development

No branches or pull requests

5 participants