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

Node 0.12 - Binary download failed, trying source #655

Closed
kmalakoff opened this issue Feb 12, 2015 · 65 comments
Closed

Node 0.12 - Binary download failed, trying source #655

kmalakoff opened this issue Feb 12, 2015 · 65 comments
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. OS: ubuntu

Comments

@kmalakoff
Copy link

It looks like the node 0.12 binary install needs to be updated....

################################################################## 100.0%

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.

################################################################## 100.0%
@ljharb
Copy link
Member

ljharb commented Feb 12, 2015

What OS and shell are you using? The binary and source installs both work for me on my Mac in bash.

@jvillasante
Copy link

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.

@ljharb
Copy link
Member

ljharb commented Feb 12, 2015

@jvillasante What's the output of nvm_get_os and nvm_get_arch on your machine?

@ljharb ljharb added installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR. OS: ubuntu labels Feb 12, 2015
@jvillasante
Copy link

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.

@ljharb
Copy link
Member

ljharb commented Feb 12, 2015

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

@kmalakoff
Copy link
Author

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.

@rob-mccann
Copy link

I'm getting this intermittently.

Interestingly, on 0.23.3 it works but I get 'command node cannot be found'

@wumsdi
Copy link

wumsdi commented Feb 14, 2015

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.

@ljharb
Copy link
Member

ljharb commented Feb 14, 2015

@wumsdi What OS and shell?

@wumsdi
Copy link

wumsdi commented Feb 14, 2015

@ljharb Mint 17, bash

Oh, sorry. Should have updated first. 0.23.3 works as expected.

@ljharb
Copy link
Member

ljharb commented Feb 14, 2015

@rob-mccann On what step do you get that error? Can you paste some output? Also, which OS and shell?

@rob-mccann
Copy link

@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.

@ljharb
Copy link
Member

ljharb commented Feb 16, 2015

@rob-mccann Why is $NVM_DIR set to /usr/local/nvm? By any chance did you install nvm via homebrew?

@rob-mccann
Copy link

I set it to that manually - I'm on Ubuntu so no homebrew - where's better?

@ljharb
Copy link
Member

ljharb commented Feb 16, 2015

@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?

@rob-mccann
Copy link

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

@rob-mccann
Copy link

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

@rob-mccann
Copy link

Did the install paths change from $NVM_DIR/versions/v$NODE_VERSION/bin to $NVM_DIR/versions/node/v$NODE_VERSION/bin ?

@rob-mccann
Copy link

To be clear: what's fixed it for me:

  1. Upgrade nvm to 0.23.3
  2. Check nodejs executable path

@ljharb
Copy link
Member

ljharb commented Feb 16, 2015

@rob-mccann Yes, for node 0.12 and later. Have you hardcoded the node path somewhere?

@ljharb ljharb mentioned this issue Feb 18, 2015
@Allov
Copy link

Allov commented Feb 19, 2015

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.

@ljharb
Copy link
Member

ljharb commented Feb 19, 2015

@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?

@Allov
Copy link

Allov commented Feb 19, 2015

@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?

@ljharb
Copy link
Member

ljharb commented Feb 19, 2015

@Allov if you haven't set it up manually then it's likely not. Does installing other node (and io.js) versions work fine?

@Allov
Copy link

Allov commented Feb 19, 2015

@ljharb I tried to install other version as well, no luck. I ended up compiling the node js source and installed it this way.

@ljharb
Copy link
Member

ljharb commented Feb 19, 2015

@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 :-)

@ljharb ljharb closed this as completed Apr 10, 2015
@howardroark
Copy link

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%

@magbicaleman
Copy link

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

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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?

@magbicaleman
Copy link

@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.

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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.

@magbicaleman
Copy link

@ljharb so you would suggest not to use https://github.com/xtuple/nvm. I'm unfamiliar with terms pre-shell, and per-subshell.

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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.

@magbicaleman
Copy link

@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

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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 :-)

@magbicaleman
Copy link

@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.

@ljharb
Copy link
Member

ljharb commented May 19, 2015

@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?

@magbicaleman
Copy link

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.

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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 :-)

@magbicaleman
Copy link

@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.

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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.

@magbicaleman
Copy link

@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

@ljharb
Copy link
Member

ljharb commented May 19, 2015

Looks great to me! You can also do nvm install node if you don't want to tie it to that specific version.

@magbicaleman
Copy link

@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?

@ljharb
Copy link
Member

ljharb commented May 19, 2015

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 :-)

@magbicaleman
Copy link

@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.0
  • nvm reinstall-packages 0.12.3

@ljharb
Copy link
Member

ljharb commented May 19, 2015

Also, a shortcut is nvm install 0.13.0 --reinstall-packages-from=0.12.3 or nvm install node --reinstall-packages-from=node etc.

@userAbhishek
Copy link

Got the same error!
######################################################################## 100.0%
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.
######################################################################## 100.0%
File "./configure", line 362
'''
^
SyntaxError: Missing parentheses in call to 'print'

nvm: install v0.12.7 failed!

I then created 'versions' folder inside .nvm folder in my home dir!
This installed the nodejs like charm!

@ljharb
Copy link
Member

ljharb commented Aug 7, 2015

@userAbhishek What does type mkdir and alias mkdir print out?

@userAbhishek
Copy link

"mkdir is /bin/mkdir"
"bash: alias: mkdir: not found"

@ljharb
Copy link
Member

ljharb commented Aug 7, 2015

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. ¯_(ツ)_/¯

@userAbhishek
Copy link

@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!

@Mentioum
Copy link

I just created the versions directory and worked for me after that.

mkdir ~/.nvm/versions

@augbog
Copy link

augbog commented Sep 10, 2015

Yup creating a ~/.nvm/versions folder worked for me as well. I'm running Mac OS X 10.10.3

@your-diary
Copy link

I was trying to execute nvm inside Docker on M1 mac, and none of the suggested solutions worked.
Using --platform=linux/amd64 image of ubuntu:latest solved the problem.

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. needs followup We need some info or action from whoever filed this issue/PR. OS: ubuntu
Projects
None yet
Development

No branches or pull requests