Blog

nodejs-logo

As you know to install Node JS on your amazing Acme Systems Aria G25 board you must have a lot of time to local compile from source code. Now I want to use my Debian Wheezy 7.2 virtual machine to cross compiling Node JS for ARM Aria G25 and make my board able to use nvm for manage more versions of Node. Let’s take look.

1. Prepare your development machine

To prepare your development environment you can follow the step one from my previous guide that I can copy below for your convenience:

root@acmedev64:~# echo deb http://www.emdebian.org/debian/ wheezy main >> /etc/apt/sources.list
  • Update the index of packages available on this new repository:
root@acmedev64:~# aptitude install emdebian-archive-keyring
root@acmedev64:~# aptitude update
  • Install the toolkit and other prerequisites
root@acmedev64:~# aptitude install libc6-armel-cross libc6-dev-armel-cross
root@acmedev64:~# aptitude install binutils-arm-linux-gnueabi
root@acmedev64:~# aptitude install gcc-4.7-arm-linux-gnueabi
root@acmedev64:~# aptitude install g++-4.7-arm-linux-gnueabi
root@acmedev64:~# aptitude install uboot-mkimage
root@acmedev64:~# aptitude install libncurses5-dev
root@acmedev64:~# aptitude install git bc curl
  • Set default compiler

Now you can set the right compiler typing:

root@acmedev64:~# update-alternatives --install /usr/bin/arm-linux-gnueabi-gcc arm-linux-gnueabi-gcc /usr/bin/arm-linux-gnueabi-gcc-4.7 100
root@acmedev64:~# update-alternatives --set arm-linux-gnueabi-gcc /usr/bin/arm-linux-gnueabi-gcc-4.7
root@acmedev64:~# update-alternatives --auto arm-linux-gnueabi-gcc
root@acmedev64:~# update-alternatives --install /usr/bin/arm-linux-gnueabi-g++ arm-linux-gnueabi-g++ /usr/bin/arm-linux-gnueabi-g++-4.7 100
root@acmedev64:~# update-alternatives --set arm-linux-gnueabi-g++ /usr/bin/arm-linux-gnueabi-g++-4.7
root@acmedev64:~# update-alternatives --auto arm-linux-gnueabi-g++

Note: The environment is built to compile also the bootloader and the kernel. If you want prepare a new rootfs install QEMU as in the original post.

2. Cross compiling Node JS

To build Node I’ve created a script that download the source code, set the compiler options and create a tarball to deploying into the physical device. You can download this script from GitHub and copy in your home directory:

root@acmedev64:~# wget https://raw.github.com/mgesmundo/arm-dev-toolkit/master/buildnode.sh
root@acmedev64:~# chmod +x buildnode.sh
root@acmedev64:~# ./buildnode.sh v0.10.21

After a while you can see a new file called node-v0.10.21-linux-armv5.tar.gz placed in /root/.nvm/ folder and copy into your Aria board:

root@acmedev64:~# scp .nvm/node-v0.10.21-linux-armv5.tar.gz root@xx.xx.xx.xx:/root
The authenticity of host 'xx.xx.xx.xx (xx.xx.xx.xx)' can't be established.
ECDSA key fingerprint is yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy:yy.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xx.xx.xx.xx' (ECDSA) to the list of known hosts.
root@xx.xx.xx.xx's password: 
buildnode.sh                                                                100% 2611     2.6KB/s   00:00    

where xx.xx.xx.xx is the IP address of your Aria board (on the same network of your development machine).

3. Deploy Node JS on Aria G25

Login into your Aria G25 and install a modified version of the standard nvm to manage more than one Node version:

root@ariag25:~# curl https://raw.github.com/mgesmundo/nvm/master/install.sh | sh

Logout and login again into your Aria board and type:

root@ariag25:~# nvm deploy v0.10.21 node-v0.10.21-linux-armv5.tar.gz
root@ariag25:~# nvm alias default v0.10.21
root@ariag25:~# node -v
v0.10.21

Done: your Node is ready to go!

Note: For the other 0.10.x (or higher) you can change typed command according the required version.

NodeJs v0.10.25 for Aria G25

Reference

Install the ARM9 cross toolchain
Node JS ARM builder


 ,  ,

About Marcello Gesmundo

I'm the founder of Yoovant company. I'm an engineer and an artist: what could be better than combine the technologies with the arts?

9 Comment(s)
  1. Vitor A December 9, 2013 at 00:29

    Hi, command nvm deploy does not exist..
    Could you tell me how to finish instalation?

    Regards

    • Marcello Gesmundo December 9, 2013 at 08:51

      Hi Vitor,
      before to start buildnode.sh script please verify your tmp definition in buildnode script. Note that your linux machine used for cross compiling does not have Node.js and npm installed locally. After compiling, you can see the folder v0.10.21 (under /root/.nvm folder) that contains bin/npm and lib/node_modules/npm. Deploy Node on your Aria G25 board using install script as mentioned into the post. Remember that the installation is made for nvm: on your Aria G25 you can verify:

      root@ariag25:~# which npm
      /root/.nvm/v0.10.21/bin/npm
      

      Feel free to post again in case of difficulty.
      Best regards
      Marcello

  2. Vacmm February 5, 2014 at 02:02

    Hi, I’ve done your steps and have the node-v0.10.25-linux-armv5.tar.gz file in ariag25 board fresh debian and nvm installed.
    But something is going wrong, if I do command:
    nvm deploy v0.10.25 node-v0.10.25-linux-armv5.tar.gz .Nothing happen, nvm show all commands available, but command deploy is not listed.. Even if i do nvm alias default v0.10.25 still not have node working..
    Any wrong procedure?

    Regards

    • Marcello Gesmundo February 5, 2014 at 21:11

      Hi Vitor

      in your .nvm folder can you see the tree of the node installation?

      Marcello

  3. Vacmm February 8, 2014 at 02:44

    Hello, are u refering to src directory?

    root@controlo:~# cd /root/.nvm
    root@controlo:~/.nvm# ls
    node-v0.10.25-linux-armv5.tar.gz src v0.10.25

    Best regards

  4. Vacmm February 8, 2014 at 03:09

    Last post was in Linux machine, this is content on ariag25

    root@ariag25:~/.nvm# ls
    LICENSE.md README.markdown alias bash_completion bin install-gitless.sh install.sh nvm.sh package.json src test

    Regards

    • Marcello Gesmundo February 10, 2014 at 10:13

      Hi Vitor,

      sorry for delay: at this moment I’m a little bit busy for the upcoming Embedded World 2014 at Nuremberg :-)

      In your Aria G25 board you should have this:

      root@ariag25:~# .nvm/v0.10.25/bin/node -v
      v0.10.25
      

      I’ve attached the full tar file with NodeJs v0.10.25 for Aria G25: you can try with this file in your Aria G25 board and follow the steps below:

      root@ariag25:~# nvm deploy v0.10.25 node-v0.10.25-linux-armv5.tar.gz
      root@ariag25:~# nvm alias default v0.10.25
      root@ariag25:~# node -v
      v0.10.25
      

      I hope this helps you.

      Regards,

      Marcello

  5. Fitim Skenderi February 25, 2014 at 01:09

    Hi,

    thanks for the post. when trying to use :
    curl https://raw.github.com/mgesmundo/nvm/master/install.sh | sh

    I get the following error:
    SSL certificate problem: certificate is not yet valid

    Any suggestions ?

    Regards

    Fitim

  6. Marcello Gesmundo February 25, 2014 at 07:46

    Hi Fitim,
    the problem is related to your installed CA certificates. Please follow this http://stackoverflow.com/questions/3777075/ssl-certificate-rejected-trying-to-access-github-over-https-behind-firewall/4454754#4454754
    to solve your problem.
    Best regards.
    Marcello

Leave a Reply to Vitor A Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>