2

I tried many ways now to install the current 0.10.26 version of node.js.

the machine is a Arm Cortex A9 with Xubuntu 12.04 installed on:

lsb_release -a

gives me:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:        12.04
Codename:       precise

uname -a

gives me:

Linux utilite-ubuntu-desktop 3.0.35-cm-fx6-4 #123 SMP Thu Sep 12 10:41:30 IST 2013 armv7l armv7l armv7l GNU/Linux

when I install node.js the easy way doing:

sudo apt-get install git-core curl build-essential openssl libssl-dev
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs 

I end up with node.js version

v0.6.12

during the installation of node.js I get the following output:

The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/629 kB of archives.
After this operation, 2186 kB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 164415 files and directories currently installed.)
Unpacking nodejs (from .../nodejs_0.6.12~dfsg1-1ubuntu1_armel.deb) ...
Processing triggers for doc-base ...
Processing 1 added doc-base file...
Registering documents with scrollkeeper...
Processing triggers for man-db ...
Setting up nodejs (0.6.12~dfsg1-1ubuntu1) ...
update-alternatives: using /usr/bin/node to provide /usr/bin/js (js) in auto mode.

Does this mean: "Selecting previously unselected package nodejs" he will install former installed versions again? Or why is he not selecting the most recent verison?

Anyway then I completely uninstalled it using nearly this instruction: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

I found instructions that did something like this (the following wold be my case):

sudo apt-get install nodejs=0.10.26-1chl1~precise1

but it gave me only:

E: Version '0.10.26-1chl1~precise1' for 'nodejs' was not found

So I downloaded and installed nvm version v0.5.1 and when I do

nvm install v0.10.26

I get:

######################################################################## 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.
Additional options while compiling:

######################################################################## 100.0%
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'arm_fpu': 'vfpv3',
                 'arm_neon': 0,
                 'armv7': 1,
                 'clang': 0,
                 'gcc_version': 46,
                 'host_arch': 'arm',
                 'node_install_npm': 'true',
                 'node_prefix': '/home/utilite/.nvm/v0.10.26',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_unsafe_optimizations': 0,
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'node_use_systemtap': 'false',
                 'python': '/usr/bin/python',
                 'target_arch': 'arm',
                 'v8_enable_gdbjit': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_use_arm_eabi_hardfloat': 'false',
                 'v8_use_snapshot': 'true'}}
creating  ./config.gypi
creating  ./config.mk
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/utilite/.nvm/src/node-v0.10.26/out'
make[1]: Warning: File `/home/utilite/.nvm/src/node-v0.10.26/out/Release/.deps//home/utilite/.nvm/src/node-v0.10.26/out/Release/libv8_nosnapshot.a.d' has modification time 4.4e+04 s in the future
  LD_LIBRARY_PATH=/home/utilite/.nvm/src/node-v0.10.26/out/Release/lib.host:/home/utilite/.nvm/src/node-v0.10.26/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p /home/utilite/.nvm/src/node-v0.10.26/out/Release/obj.target/v8_snapshot/geni; "/home/utilite/.nvm/src/node-v0.10.26/out/Release/mksnapshot" --log-snapshot-positions --logfile "/home/utilite/.nvm/src/node-v0.10.26/out/Release/obj.target/v8_snapshot/geni/snapshot.log" "/home/utilite/.nvm/src/node-v0.10.26/out/Release/obj.target/v8_snapshot/geni/snapshot.cc"
^Cmake[1]: *** [/home/utilite/.nvm/src/node-v0.10.26/out/Release/obj.target/v8_snapshot/geni/snapshot.cc]

There it runs in a loop until I hit Cntrl C. Unfortuantely the same happens when trying to do it with the git:

git clone https://github.com/joyent/node.git

it compiles and then hangs in an infinite loop (tried it several hours allready). The process hanging is mksnapshot. I found the following issue on V8 regarding a similar behaviour: http://code.google.com/p/v8/issues/detail?id=884 They talk about gcc 4.5.x where my is 4.6.3.

So at this point I do not know any futher and would highly appreachiate any kind of help. it looks like something is wrong with my linux here but I do not know where to start.

many thanks,

Benjamin

Community
  • 1
  • 1
B Piltz
  • 115
  • 9

4 Answers4

2

The binaries in the PPA are for x86/x86_64, not ARM. You will have to install from source (or try the pre-compiled Raspberry Pi binary if you want).

If you're cloning from git, you're checking out the master branch by default which is unstable. Here's a one-liner that installs the latest stable version that you might try instead:

rm -rf /tmp/node-install && mkdir /tmp/node-install && pushd . && cd /tmp/node-install && curl -L http://nodejs.org/dist/node-latest.tar.gz | tar zx && cd `ls | grep node` && ./configure && make && make install && popd && rm -rf /tmp/node-install
mscdex
  • 93,083
  • 13
  • 170
  • 135
  • Many thanks, mscdex, for your answer. The second link hangs as well as my other attempts when trying to generate snapshot.cc (running mksnapshot). – B Piltz Apr 30 '14 at 08:08
  • Mscdex, this may be quite odd but could you give me (or point me to) a short instruction on how to install the pre-compilde binaries? – B Piltz Apr 30 '14 at 08:11
  • ok I just unpacked the tar.gz and put a symbolic link into the /usr/bin directory pointing to the node execuable in the bin folder of the unpacked archive but what I get when I run "node -v" is: -bash: /usr/bin/node: No such file or directory. This is the Link: lrwxrwxrwx 1 root root 50 Apr 30 09:12 node -> /usr/local/bin/node-v0.10.26-linux-arm-pi/bin/node – B Piltz Apr 30 '14 at 09:22
  • I think this may be due to the compiled version does not run on my machine (A7 Cortex). – B Piltz Apr 30 '14 at 09:45
  • It will do B Plitz. You need to compile the source code with a custom configuration for ARM. I've got an Utilite Pro and I was able to install and run it. Here is how I managed to install it step by step (Spanish but you can do copy-paste commands) http://www.ibaivalencia.com/instalar-y-ejecutar-node-js-en-una-maquina-arm-con-linux/ – Ibai Apr 30 '14 at 17:26
  • Hey Ibai, many thanks it workes well. I just installed the version 0.10.26 as you decribed. Unfortunately npm is not running at the moment or lets say if I type npm -v I just get a empty line and I have to quit witch cntrl C. I will try to install it manually now. – B Piltz May 01 '14 at 11:09
  • Ok npm does not work because node does not work. Just entered node now and I do not get the console. I have a utilite standard here by the way. I will try to install now your version exactly and see if I can run that one. – B Piltz May 01 '14 at 11:20
  • 0.11.9 works fine now including npm. Hopefully my required modules will work there. If you like, Ibai, post your answer as answer here so I can mark it as the correct solution and it is easier to find. Many thanks! – B Piltz May 01 '14 at 12:18
  • Hi B Piltz, I'm glad you got it work! I'll post it as an answer and write that 0.10.26 does not work correctly. – Ibai May 01 '14 at 12:56
2

As you specify in your posts, you are running the Utilite Standard which runs over ARM processor. I've been able to make Node.js work but you will need to compile the source code with a custom configuration for ARM processor.

In addition, I should point that 0.10.26 version is not working so just try with 0.11.9 which will compile Node and NPM.

Here is how I managed to install it step by step, sorry because it's in Spanish but you can copy-paste commands.

http://www.ibaivalencia.com/instalar-y-ejecutar-node-js-en-una-maquina-arm-con-linux/

Ibai
  • 558
  • 1
  • 7
  • 20
  • thanks Ibai, did you manage any other 0.10.x version to run successfully? Unfortunately one package I need (usb) is not unning under 0.11 yet. – B Piltz May 01 '14 at 16:11
  • I know that it's not a stable version but it's the one that works over ARM... I hope that package is upgraded for 0.11. However, I havent tried any other 0.10 version. Maybe you can try them, you know the steps now with the tutorial, it would be just change the source code download url. – Ibai May 01 '14 at 18:58
  • 1
    OK I tested the various versions of 0.10 and the shift occures between 0.10.22 and 0.10.23. from 23 of the console freezes. Befor it seems to work well as far as I tested it (you hello world and my application). Maybe the change-list from 22 to 23 of the release pages http://blog.nodejs.org/release/1 may give hint to what causes the error. But I do not be able to retreive any approaches from this. But it is not so impoertant I can live well with the 0.10.22. Again many thanks for the valuable hints, Ibai! – B Piltz May 03 '14 at 14:23
  • That's a nice research job B Plitz, I cannot imagine how much time you spent compiling those versions with a Standard Utilite! Glad that you got a 0.10.* working with your app :) – Ibai May 04 '14 at 15:20
  • 1
    It was not that hard because I did not co pile each of them and did it alongside other tasks. Here are the specifitc versions I tested: 1.10.1, 11, 17, 20, 21, 22 (all worked). Unfortunately I now have a problem with the "usb" module for node.js although it worked on my x86 machine well. Did you use it yet on the arm if so what usblib-version (I guess we should open another thread then)? – B Piltz May 04 '14 at 19:35
2

try ./configure --without-snapshot --dest-cpu=arm --dest-os=linux

user3358452
  • 67
  • 1
  • 5
  • 1
    Generally, answers are much more helpful if they include an explanation of what the command is intended to do, and why that solves the problem when other possibilities don't. – Nathan Tuggy Feb 09 '15 at 02:36
0

I encountered this kind of problem (infinite loop during mksnapshot) during the make compilation of "shiny-server" which requires node.js ; on a ARM processor (ODROID). Actually, the version of node.js in the makefile was 0.10.40. Going back to 0.10.21 fixed the problem.

H. Seldon
  • 1
  • 2