1 2 Previous Next 18 Replies Latest reply on Sep 27, 2017 9:39 AM by FGT

    How to update node.js in the SD card image to the latest release

    AlexT_Intel

      As you know, the larger Galileo "SD card" image contains Node.js. However it's relateively old, 0.8.<something>, while the current version is 0.10.25.

       

      Someone has asked me if it would be possible to upgrade the packaged version and how hard it is. It turns out it's rather easy with Yocto.

       

      There's a recipe which builds bundled 0.8.x version and all we need to do is to override it, correcting the version number and MD5 & SHA sums for source tarball and license file and after that run bitbake nodejs command (provided you have BSP build environment in place). No other recipe corrections required.

       

      If you don't have an ability or desire to build the package yourself - I'm attaching the new one to this post. You'll need to unzip it and upgrade the installed one using opkg.

       

      It's built on 0.8.0 BSP, but theoretically it should work for all current BSP images (0.7.5, 0.8.0, 0.9.0).

      Just create a backup copy of your image-full-clanton.ext3 file before upgrading and you will always be able to revert in case something goes wrong.

      # Assuming your SD card is E:\ in Windows, for Linux just correct respectively

      # on your PC in cmd session run this:

      copy E:\image-full-clanton.ext3 E:\image-full-clanton.ext3.before_nodejs_update

      # on Galileo run this (copy the package over to e.g. /tmp first using e.g. scp)

      opkg upgrade /tmp/nodejs_0.10.25-r0_i586.ipk

       

      If you want to build your package, I've added the recipe to my Yocto layer to make it even easier, here's a step-by-step guide:

       

      1) First, use the instructions from http://github.com/alext-mkrs/meta-alext-galileo to prepare the full environment from scratch, or just add my meta-alext-galileo layer to your existing one. I haven't tested this with those LSB-compliant with SDK images created by SergeyK's recipe. Theoretically should work as-is, but YMMV.

       

      2) Enable the node.js recipe in recipes-addfeatures/nodejs-latest directory (remove the ".disabled" from the recipe name)

      cd meta-alext-galileo/recipes-addfeatures/nodejs-latest

      mv nodejs_0.10.25.bb.disabled nodejs_0.10.25.bb

      3) Then run the bitbake command

      bitbake nodejs

      4) Then copy the resulting package over from your meta-clanton*/yocto_build/tmp/deploy/ipk/i586 directory to Galileo using e.g. scp and run the opkg upgrade command as noted above.

       

      5) Alternatively to (4), if you enabled the package repo over the network per my other HowTo (https://communities.intel.com/thread/48408), then run the following commands (that's what I did personally):

      # on the build host

      bitbake package-index

       

      # on Galileo

      opkg update

      opkg upgrade nodejs

       

      That's it, you should have the latest node.js version installed on yor Galileo now.

      I've tested that and it ran several "hello world" and HTTP server examples just fine.

       

      Feel free to ask questions in this thread, should something not work for you.

       

      UPDATE 04-Feb-2014: You can also install the package from the now-available package repo, see instructions here: Re: How to enable the Yocto-provided package management capability

        1 2 Previous Next