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

Failed install #919

Closed
surfeatsleep opened this issue Nov 26, 2015 · 19 comments
Closed

Failed install #919

surfeatsleep opened this issue Nov 26, 2015 · 19 comments
Labels
installing node Issues with installing node/io.js versions. installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated.

Comments

@surfeatsleep
Copy link

It's a bit of a long read (most of it is terminal input/output though), so please stick with me.

Summary

I ran curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash multiple times and still keep getting command not found

Long version

I tried installing nvm by opening the terminal and running

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

but it complained with:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

I tried to exit and reopen terminal and got:

-bash: nvm: command not found

Seemed expected, so I went and manually agreed to XCode terms.

Than I reopened the terminal and tried running the following command again

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

this time it complained with the following:

=> Profile not found. Tried  (as defined in $PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
=> Create it (touch ) and run this script again
   OR
=> Append the following lines to the correct file yourself:

export NVM_DIR=“/Users/Surfeatsleep/.nvm”
[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh”  # This loads nvm

Realising I didn't have a .bash_profile, I created within /Users/Surfeatsleep/ and pasted

export NVM_DIR=“/Users/Surfeatsleep/.nvm”
[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh”  # This loads nvm 

reopened the terminal again and got

-bash: nvm: command not found

So, again I typed

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

It said some stuff already exists and I should close and reopen terminal, so I did.
I tried running nvm again, but again I got

-bash: nvm: command not found

I checked to see if nvm is installed

cd .nvm
ls
CONTRIBUTING.md Makefile    bash_completion nvm-exec    package.json
LICENSE.md  README.markdown install.sh  nvm.sh      test

Am I missing something? Why isn't nvm running? Did I mess up by running
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash multiple times?
Since I am not all that proficient with the terminal I would appreciate all the help I can get


P.S.: I am running OS X ver. - 10.11.1

@surfeatsleep
Copy link
Author

Also note, that if I use: . $NVM_DIR/nvm.sh (as suggested #889) and than running nvm ls it returns:

            N/A
node -> stable (-> N/A) (default)
iojs -> N/A (default)

I'm guessing this means nvm is installed (and no node os iojs are which is what I would expect at the moment).

Can someone please:

  • confirm I didn't mess anything up by calling curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash several times (as described above)
  • tell me how to make nvm work without entering . $NVM_DIR/nvm.sh every time I open the terminal

@ljharb
Copy link
Member

ljharb commented Nov 26, 2015

@surfeatsleep that first message you got is a Mac thing. Run sudo make or something on the command line to agree to the terms and conditions, and then your command line tools will work.

@ljharb
Copy link
Member

ljharb commented Nov 26, 2015

I can definitely confirm that calling the install script multiple times will not mess anything up.

If, after fixing your command line tools, and rerunning the install script, it's still not working - check for ~/.bash_profile and ~/.bashrc - you may need to follow the last part of the manual instructions here until #904 is resolved.

@ljharb ljharb added installing node Issues with installing node/io.js versions. installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. labels Nov 26, 2015
@surfeatsleep
Copy link
Author

Thanks for the info.

I've created all three, .bashrc, .bash_profile and .profile and pasted the following:

export NVM_DIR=“/Users/Surfeatsleep/.nvm”
[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh”  # This loads nvm 

still it wouldn't work.

I tried instead pasting:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

into .bashrc, .bash_profile and .profile and now it works!
(turns out I need this to be in .bash_profile only)

The solution for my problem seems to have been using the $HOME variable instead of /Users/Surfeatsleep <--- not sure why this was an issue.

Thanks for your input!

P.S.: I know it's somewhat off-topic, but should I remove .bashrc and .profile or just leave them empty?

@ljharb
Copy link
Member

ljharb commented Nov 26, 2015

hmm, perhaps the capitalization. do you have any symlinks anywhere, or is your $HOME directory mounted on a different drive?

Might as well remove them if they're empty but it shouldn't matter either way.

@surfeatsleep
Copy link
Author

I am not aware of any symlinks and it's on the same drive.
Also if I echo $HOME I get /Users/Surfeatsleep, so not sure why it doesn't work with the literal path but does with the$HOME variable.

@ljharb
Copy link
Member

ljharb commented Nov 27, 2015

@surfeatsleep what about whoami?

@bugthunk
Copy link

https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh installed stuff in the directory '~' in my home directory. Check this. It works for me now, don't know what changed. I certainly did not change a thing.

@surfeatsleep
Copy link
Author

@ljharb
sorry, not sure why I had Surfeatsleep in uppercase, it's actually in lowecase (guess it could have been some odd autocomplete, since I typed it in the first time and than repasted the incorrect verision all over this topic). Again, sorry for the confusion, the actual directory is in fact /Users/surfeatsleep.

I tried checking echo $HOME (returns /Users/surfeatsleep) and whoami (returns surfeatsleep).

Nonetheless, if I edit the .bash_profile to be:

export NVM_DIR="/Users/surfeatsleep/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

it doesn't not work, however the following does:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

@bugthunk
The installation directory seems to be in the right folder: /Users/surfeatsleep/.nvm
If it helps you, ~/ is a shortcut for the home folder of a user in OS X

Long story short
The solution (for me at least) seems to be to just stick to using $HOME instead of the literal path.

@bugthunk
Copy link

If it helps you, ~/ is a shortcut for the home folder of a user in OS X

Thanks, I know. That was my point, although perhaps I wasn't too clear about this :)

@ljharb
Copy link
Member

ljharb commented Nov 27, 2015

@bugthunk That's also very odd. Do you have any shell options set in your bashrc or bash_profile?

@surfeatsleep both when it works and doesn't work, what does echo $NVM_DIR on the command line print out?

@surfeatsleep
Copy link
Author

@ljharb
Sorry to disappoint, but it seems I can no longer replicate the issue.

@simonh1000
Copy link

I'm having a related issue. I have nvm in my path but neither node not npm are there. I've tried nvm use 5.0 but that does no survive a restart of terminal

@surfeatsleep
Copy link
Author

@simonh1000 I'm no expert at nvm, but perhaps this can help:
#658 (comment)

@ljharb
Copy link
Member

ljharb commented Nov 27, 2015

@surfeatsleep thanks, I'll close this then

@ljharb ljharb closed this as completed Nov 27, 2015
@ljharb ljharb added the non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated. label Nov 27, 2015
@simonh1000
Copy link

@surfeatsleep - Genius - Thanks

@MattFoley
Copy link

This might need to be re-opened, or perhaps another issue added. This curl command no longer works in Mac OSX Sierra on my 2016 Macbook Pro (Touch Bar). This only works if you accept the Xcode license agreement manually by opening Xcode prior to running this script.

sudo curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

Here's the output if you haven't yet accepted the Xcode license agreement:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10250  100 10250    0     0  56285      0 --:--:-- --:--:-- --:--:-- 56318
=> Downloading nvm from git to '/Users/tjfallon/.nvm'
=> 

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.


Failed to clone nvm repo. Please report this!

Once you do, it's fine again.

@ljharb
Copy link
Member

ljharb commented Jan 8, 2017

@MattFoley this has been true for multiple versions of Mac OS - lots of terminal commands won't work until you've accepted the Xcode license agreement first. That's just sadly one of the things any developer must know the first time they use a new Mac.

Since the output tells you exactly what to do, there's not really anything nvm can or should do to fix it.

@MattFoley
Copy link

MattFoley commented Jan 8, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. non-issue / invalid This isn't relevant to nvm, or turned out to be something unrelated.
Projects
None yet
Development

No branches or pull requests

5 participants