It looks like the node 0.12 binary install needs to be updated....
mv: rename /Users/me/.nvm/bin/node-v0.12.0-darwin-x64 to /Users/me/.nvm/versions/v0.12.0: No such file or directory
Binary download failed, trying source.
What OS and shell are you using? The binary and source installs both work for me on my Mac in bash.
It happens to me too, on ubuntu 14.04. I have nvm installed with node 0.11.14 (unstable) running fine, when I try to nvm install stable it give me the error:
โ ~ nvm install stable
######################################################################## 100,0%
mv: cannot move โ/home/jvillasante/.nvm/bin/node-v0.12.0-linux-x64โ to โ/home/jvillasante/.nvm/versions/node/v0.12.0โ: No such file or directory
Binary download failed, trying source.
@jvillasante What's the output of nvm_get_os and nvm_get_arch on your machine?
Well, I just did rm -rf ~/.nvm, then install it again and it worked ok with last 0.12.0 stable version of node. Never mind about my comment.
ah ha, that actually might be a clue as to what's going on. There's an explicit line in the code that does mkdir -p on the version path, but it's possible that line is failing somehow
I am using OSX 10.9.5. I originally tried deleting ~/.nvm and reinstalling nvm, but that didn't fix the problem.
Then, I let the build from source run after getting that message and now it seems to be working and I can successfully install 0.12 from binary.
So the fail to install from binary happened twice, but third time (and on) the charm.
I'm getting this intermittently.
Interestingly, on 0.23.3 it works but I get 'command node cannot be found'
Had the same problem.
mv: cannot move โ/home/wumsdi/.nvm/bin/node-v0.12.0-linux-x64โ to โ/home/wumsdi/.nvm/versions
/v0.12.0โ: No such file or directory
Made the missing ('/home/wumsdi/.nvm/versions') directory myself - seems to work.
@wumsdi What OS and shell?
@ljharb Mint 17, bash
Oh, sorry. Should have updated first. 0.23.3 works as expected.
@rob-mccann On what step do you get that error? Can you paste some output? Also, which OS and shell?
@ljharb
I run nvm install 0.12.0 in a Docker container (Ubuntu 14.04 base image) in a VM on OSX using bash.
https://gist.github.com/rob-mccann/d881855fdc49e47bc831
FYI - I'm relatively new to Docker so I'm not sure if I'm the cause here.
@rob-mccann Why is $NVM_DIR set to /usr/local/nvm? By any chance did you install nvm via homebrew?
I set it to that manually - I'm on Ubuntu so no homebrew - where's better?
@rob-mccann ok, as long as you set it manually it's cool :-) Default though is $HOME/.nvm because nvm should be installed per-user, not shared across user accounts.
In your gist, after "=> Close and reopen your terminal to start using nvm" i see an installation progress bar - what starts that installation?
Not too sure what you're after but here's the command that sets it all off.
curl https://raw.githubusercontent.com/creationix/nvm/v0.22.0/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
Building from source works FYI but takes forever :)
Using 0.23.3 gets the following output:
https://gist.github.com/rob-mccann/37712f2b07def4b2187f
ie, nvm seems to work but it then can't find node
Did the install paths change from $NVM_DIR/versions/v$NODE_VERSION/bin to $NVM_DIR/versions/node/v$NODE_VERSION/bin ?
To be clear: what's fixed it for me:
@rob-mccann Yes, for node 0.12 and later. Have you hardcoded the node path somewhere?
Can't get it to work either, getting checksum empty. I'm using crouton to mount a trusty ubuntu 14.04:
(trusty)allov@localhost:~$ nvm install v0.12.0
######################################################################## 100.0%
Checksums empty
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Binary download failed, trying source.
@Allov checksums empty isn't likely to be the problem - it seems like the untarring failed. Are you using a nodejs.org mirror, or going through a proxy?
@ljharb mm, I'm on my local wan through my chromebook. I'm not using a proxy. How would I know if this is a nodejs.org mirror?
@Allov if you haven't set it up manually then it's likely not. Does installing other node (and io.js) versions work fine?
@ljharb I tried to install other version as well, no luck. I ended up compiling the node js source and installed it this way.
@Allov If you're unable to install any binary versions then I'd love to work with you to figure it out - hop onto #nvm on freenode sometime and we'll work through it :-)
Happened to me too,
@wumsdi +1
Creating .nvm/versions directory solved it for me
Creating .nvm/versions directory worked for me too :+1:
I could send a pull request that fixes this, ensuring creation of .nvm/versions
@asyncanup This issue is still open because the code is already doing that, and I can't figure it out nor reproduce the problem - if you can provide a reproducible automated test, whether with a fix or not, that would be very appreciated!
After a while, I was able to install in my rasperry pi. But only the version 0.11.9, because the version 0.12.0, don't have the arm-pi.tar.gz distribution available.
@favio41 yes, raspberry pi is a different issue, since 0.11.9 and 0.10.16 are the last versions of node that come with those distributions.
RPi user here, thanks @favio41 "nvm install 0.11.9" solved my problem for me, @ljharb thanks for explaining why that worked.
@Hadlock @favio41 fwiw the latest nvm works fine with raspberry pi with io.js :-)
If you have Virtualbox and Vagrant installed you can clone the following gist to boot a system where this occurs: https://gist.github.com/howardroark/25550e799297fafb3b94
It uses the official Ubuntu 14.04 Vagrant box from their servers. It seems to be a non-issue because it only occurs with older versions of nvm. I was able to recreate with v0.22.0.
@howardroark thanks for that! A reproducible test case is amazing, and I'm relieved you've confirmed that it's been fixed since v0.22.0 :-)
Yup!
Latest release:
vagrant@vagrant-ubuntu-trusty-64:~$ nvm install stable
######################################################################## 100.0%
Now using node v0.12.2
0.22.0:
vagrant@vagrant-ubuntu-trusty-64:~$ nvm install stable
######################################################################## 100.0%
mv: cannot move โ/home/vagrant/.nvm/bin/node-v0.12.2-linux-x64โ to โ/home/vagrant/.nvm/versions/v0.12.2โ: No such file or directory
Binary download failed, trying source.
######################################################################## 100.0%
On a vagrant bash file for the following OS (config.vm.box="ubuntu/trusty64").
I had to export HOME and NVM_DIR as "/home/vagrant" and "/home/vagrant/.nvm" then _source "/home/vagrant/.nvm/nvm.sh"_ and then thanks to @wumsdi added _mkdir /home/vagrant/.nvm/versions_ and was able to install 0.12.3
I'm mystified how that last step would be necessary. nvm.sh explicitly calls mkdir -p $NVM_DIR/versions - is mkdir -p somehow not available on your system?
@ljharb turns out this caused a permission issues, as you mentioned if you export HOME or NVM_DIR you would need to handle permissions on your own.
I went back to the drawing board, and added _privileged false_ to my vagrant file, so that my bash runs as "vagrant" user, when one does vagrant up.
config.vm.provision "shell", path: "nvm_install.sh", privileged: false
This all works with the following bash;
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y install build-essential libssl-dev
curl https://raw.githubusercontent.com/creationix/nvm/v0.17.2/install.sh | bash
source ~/.nvm/nvm.sh
mkdir ~/.nvm/versions
nvm install 0.12.3
nvm use 0.12.3
The only issue for me is that if you vagrant ssh, and the run "node" it does not find it, until I run the command;
nvm use 0.12.3
Also finding out that this does not install node globally might be a drawback. So I'm also looking into https://github.com/xtuple/nvm.
nvm is for per-shell, https://npmjs.com/nave is for per-subshell, and https://npmjs.com/n is for global. It appears that particular nvm fork is from a long time ago, as it lacks io.js support, for one.
@ljharb so you would suggest not to use https://github.com/xtuple/nvm. I'm unfamiliar with terms pre-shell, and per-subshell.
Correct.
Per-shell means, only a shell session in which nvm.sh is sourced, and nvm use is called, will node be available. Per-subshell means, nave will launch a brand new shell session with its PATH set up properly for the requested node version to be available. n would have a single binary that's shared by the entire system, locked to one version at a time, that would mimic a more traditional node install.
@ljharb thank you.
So if I remove mkdir ~/.nvm/versions from my bash I then get the following error when install node version 0.12.3
==> default: cannot move โ/home/vagrant/.nvm/bin/node-v0.12.3-linux-x64โ to โ/home/vagrant/.nvm/versions/v0.12.3โ
So in order to get the ability to multi-version node globally I would need to get n installed instead of nvm
Yes, nvm is not intended for a global installation.
Can you confirm the permissions on $NVM_DIR? I'd love to solve this particular mkdir issue :-)
@ljharb what are the benefits of nvm not being global? Feel free to link me to a document.
Currently when using the mkdir in the bash;
drwxrwxr-x 3 vagrant vagrant 4096 May 19 20:46 versions
Without the mkdir command in my bash here it the full error
==> default: mv:
==> default: cannot move โ/home/vagrant/.nvm/bin/node-v0.12.3-linux-x64โ to โ/home/vagrant/.nvm/versions/v0.12.3โ
==> default: : No such file or directory
==> default: Binary download failed, trying source.
With the error I do have the following directory: /home/vagrant/.nvm
drwxrwxr-x 4 vagrant vagrant 4096 May 19 20:56 .
drwxr-xr-x 5 vagrant vagrant 4096 May 19 20:56 ..
drwxrwxr-x 2 vagrant vagrant 4096 May 19 20:56 bin
-rw-rw-r-- 1 vagrant vagrant 26781 May 19 20:56 nvm.sh
drwxrwxr-x 3 vagrant vagrant 4096 May 19 20:56 src
but no _versions_ folder.
@magbicaleman I'd ask what the benefits are of node being global :-)
Also, what version of nvm are you using, and what does type mkdir report?
type mkdir results mkdir is /bin/mkdir
nvm --version results 0.17.2
@ljharb No clue, I was looking at this article and it seems to be made out to be a problem that needs to be solved.
Can you try upgrading to the latest nvm (v0.25.2) with curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.2/install.sh | bash and see if you still have the issue? If so, please also provide your nvm debug output :-)
@ljharb Oh yea! that worked. So I'm trying to build vagrant box that developers may use to develop on node, when they start said box I would like to avoid them typing nvm use x.x.x is there anyway of doing that. Even though nvm is per shell.
Yes - nvm alias default node will set the default on new shell invocations (it's activated when sourcing nvm.sh), and a .nvmrc file in a given directory hierarchy will also be found by nvm use/nvm install.
@ljharb indeed so adding nvm alias default node in my bash after nvm install allowed me to jump into vagrant ssh type node and it comes up!
So this is what my current bash looks like;
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y install build-essential libssl-dev
curl https://raw.githubusercontent.com/creationix/nvm/v0.25.1/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 0.12.3
nvm alias default node
Looks great to me! You can also do nvm install node if you don't want to tie it to that specific version.
@ljharb thank you for all the help, extremely helpful and quick. Much appreciated!
Maybe this is beyond of topic, but are npm install -g packages bound to the version being used by nvm? So for example if I go from 0.12.3 with npm install gulp -g, and switch to 0.13.3 I would need to reinstall gulp globally?
Yes, which is a good thing, since modules would likely break if shared across node versions. However, look into nvm reinstall-packages which can automatically handle that for you :-)
@ljharb true that. Pretty slick feature, so if I upgrade from 0.12.3 and want my global packages I'll just;
nvm install 0.13.0nvm reinstall-packages 0.12.3Also, a shortcut is nvm install 0.13.0 --reinstall-packages-from=0.12.3 or nvm install node --reinstall-packages-from=node etc.
Got the same error!
mv: cannot move โ/home/abhishek/.nvm/bin/node-v0.12.7-linux-x64โ to โ/home/abhishek/.nvm/versions/v0.12.7โ: No such file or directory
Binary download failed, trying source.
File "./configure", line 362
'''
^
SyntaxError: Missing parentheses in call to 'print'
I then created 'versions' folder inside .nvm folder in my home dir!
This installed the nodejs like charm!
@userAbhishek What does type mkdir and alias mkdir print out?
"mkdir is /bin/mkdir"
"bash: alias: mkdir: not found"
This one keeps mystifying me - if mkdir fails to create the versions directory, it would fail with that specific error. Since it doesn't, the directory must exist. ยฏ_(ใ)_/ยฏ
@ljharb hmm it should, but it doesn't! Luckily I got a pretty neat fix for that error!
BTW I used nautilus to create the dir!
I just created the versions directory and worked for me after that.
mkdir ~/.nvm/versions
Yup creating a ~/.nvm/versions folder worked for me as well. I'm running Mac OS X 10.10.3
Most helpful comment
I just created the versions directory and worked for me after that.