-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
nvm.sh fails to source on initial install #35
Comments
That sounds a bit of a chicken and egg problem. On my bash in a vanilla Ubuntu system, I never have trouble sourcing nvm in a clean environment. Do you have anything custom or aliases setup? |
What is the value of
Restoring the alias default removes the failure. My recommendation would be to remove the 'return 13' in the case it can't find an installed node version and only error when someone attempts to pick a node version that doesn't exit. FWIW, the following bashrc function helps diagnose commands that fail by printing the return value of the previous command if not zero:
|
Sorry, I didn't see your comment. Did you ever resolve this? |
I believe I worked around it by ignoring the error and preceding with installing a node and setting it as default. I'd imagine the original error is still present though, see earlier comment for how to reproduce. |
I understand. Nothing is broken, it's just that in your environment, you're able to see the error code that I can't see in a vanilla bash environment. I'll look into fixing it if it bothers more people. |
I think I'm having the same problem; installed a fresh Ubuntu 11.04 system and sourced
It does download the source to the current directory, though. ADDED: I've additionally installed |
Okay, installing the latest node from master branch using the following:
And then opening a new shell (while having As a side effect, I've now seen that the |
I have the same problem when I upgrade my laptop to ubuntu 11.10. I didn't install any nodejs package at first, then I tried to install nodejs through nvm, but it always display "install failed!" (Both v0.4.x & v0.5.x) I put some debug code and find out that Then I do the same thing just like KrofDrakula did, fetch the node source code and install. After that, nvm could work fine. |
I also have the same problem. On a vanilla Ubuntu 11.10, NVM fails to install v0.4.12. However, it seems to have downloaded the tarball correctly. Any thoughts on the problem? |
I figured out the problem... for some reason on Ubuntu 11.10, emulation with curl is happening from the nvm.sh script. Remove that portion in the beginning of the nvm.sh file and source the update. Then make sure that the actual curl binary is installed. Why any dependence upon wget? Why not just a dependence upon curl? Why bother trying to emulate curl with wget? |
Desktop Linux doesn't usually have curl installed by default, but it does have wget. I always install curl and I think any serious web developer should have curl, but I'm not sure I should force that opinion on others. Either way, the wget emulation doesn't seem to work so I should probably remove it. |
I'd suggest the script check the availability of EDIT: just tried the suggestion by @jprichardson – installing |
Fixed in 8dad534 |
Awesome, thanks. Informative errors are way cool. :) |
Excellent! Thanks for fixing this! |
After following the installation instructions in the README, the
nvm.sh
script fails to source in bash. It will return with error code 13.After investigation, it appears the you must install a node version AND alias it to default before the script will source without error. It tries to find the active version by performing an
ls
on the install directory, and upon failing to find an installed version, returns error code 13.On initial install, the failure to find an installed node version should be a handled error. In my case, I assumed it was broken when it was returning code 13.
The text was updated successfully, but these errors were encountered: