Upgrading from Node.js 0.8.x to 0.10.0 From my PPA

The Node.js project recently pushed out a new stable version with the 0.10.0 release. This release supersedes the 0.8.x line and has a bunch of new features and enhancements. In particular, there’s a new Streams API you’ll probably want to check out. Also, the domain module has been elevated to “unstable” status, so you can start checking it out for your error handling. A lot of people seem to use my node PPA to install node on their systems, so I wanted to make a quick note about performing this upgrade.

First, in response to various user requests, I’m still going to maintain and track the 0.8.x release. This will happen in my node.js-legacy PPA. I spoke to Isaac about doing this, and the idea is that I’ll keep tracking whatever the stable release behind “current” is. So when 0.12.0 comes out, the legacy PPA will upgrade to 0.10.x and 0.8.x will go away. Please be forewarned: you all have plenty of time to get and keep really old versions if you want to now going forward.

Also to note is that the nodejs-dev and npm packages don’t exist anymore. The new nodejs package contains everything that these separate packages used to, because npm needs all the development files, and you’re not really using node these days if you’re not using npm. So we figured we’d just simplify things with the single package.

The upgrade will uninstall the previous versions, but apt can be a bit obstinate about doing this. Instead of the usual

sudo apt-get update
sudo apt-get upgrade

you will probably instead want to do something like

sudo apt-get update
sudo apt-get -y dist-upgrade

to let apt know it’s okay to go ahead with things.

Please let me know if you run into any issues in the comments.

66 thoughts on “Upgrading from Node.js 0.8.x to 0.10.0 From my PPA

      1. chris lea Post author

        Hrm. The usual configure and make install doesn’t seem to install them with this version. I’ll need to check with @izs next time I see him on IM and figure out what’s up. I’ll get this fixed as soon as I can.

        Reply
      2. chris lea Post author

        I checked, and they aren’t in my packages because the source distribution doesn’t install them anymore. Apparently npm now downloads the headers you need, so that’s the recommended way to do things. There may be a way to optionally install the headers in the future, and I’ll update my packages if that happens.

        Reply
        1. Dave Steinberg

          Thanks for your quick response! I’ll have to chat with my team and see why we’re not getting that behavior. It’s probably a FAQ somewhere we missed. 🙂

          Reply
          1. Nabeel (@nabeels)

            Just to node – node-gyp is supposed to install the headers – but there’s a bug , so it doesn’t install them in the system directory.

            The workaround that I’m doing (for now, and hopefully this is not the future behavior, as you said, this isn’t standard *nix behavior) – is to do a “node-gyp install 0.10.0” – and it will install the headers into your ~/.node-gyp/src/0.10.0 directory. You can then copy them into whichever include directory you prefer.

  1. Nabeel (@nabeels)

    Re: The missing header files

    Apparently node-gyp is supposed to install the development headers. However, there seems to be a bug or something (I posted on the mailing list, and Nathan thinks it might be a bug in core). The answer I got on IRC was “it worked for us”… and that was it. So using 0.10.0 is a no-go until these (basic) issues have been sorted out. I know it’s not your fault or anything, but it’s just pretty poor form to go change these really fundamental things, and not make a note anywhere of the detailed changes… esp when now the new places that they’re supposed to be don’t work.

    Reply
  2. Owen

    What’s the point of moving the 0.8 files into a different PPA? If you left them where they were, people could still install them specifically by doing e.g. “apt-get install nodejs=0.8.22-1chl1~precise1” Now I have to change PPAs and run apt-get update across all my systems.

    Reply
    1. chris lea Post author

      Launchpad automatically deletes old versions when you upload newer ones, so there’s no way to keep the 0.8.x ones in the same PPA once the 0.10.x ones are there. Thus the legacy repository.

      Reply
      1. Owen

        Ew. So this is a way in which Launchpad < a generic apt repo. I can see their logic (not wanting to store an infinite number of debs) but it breaks a basic feature of apt-get.

        Well, thanks for creating the legacy PPA! Am I going to get any warning when that goes away? As it is, this migration is forcing me to make a global config change to our systems, using Puppet, and then get after our engineers to validate their code against 0.10. Then another config change… 🙂

        Reply
        1. chris lea Post author

          Yes, I know it’s annoying. But I’ve never found any way to make Launchpad keep older versions of packages. As for the legacy PPA, I think I spelled it out in the blog post. The plan is that I’ll track whatever is “one version back from current” in -legacy. So when 0.12.0 comes out, I’ll push 0.10.x into -legacy and 0.8.x will vanish.

          Reply
      2. omehegan

        I just noticed that the nginx PPA has multiple versions of nginx in their one pool:

        http://ppa.launchpad.net/nginx/stable/ubuntu/pool/main/n/nginx/

        Seems like there must be a way to make this work. As other people have said recently, the possibility of unexpectedly getting a new node version, or of the version you want no longer being here when you use this PPA, is problematic for production users. I had to resort to copying your 0.8 package to my own repo to ensure we always have it.

        Reply
        1. chris lea Post author

          If you know how to make Launchpad keep old versions of things, I’m all ears! But unfortunately I’ve never been able to figure out how to do it. Also, please keep I’m mind that the NodeJS developers are no longer going to support 0.8.x once 0.12.x comes out. They really do want people to upgrade through to at least on release cycle back from current.

          Reply
  3. Rich

    Chris, Can you clarify this comment “Apparently npm now downloads the headers you need, so that’s the recommended way to do things.”

    As I’m not seeing npm download the headers anywhere. This is problematic for those who are building native modules but would like to upgrade to 0.10. What is the node recommended way to get the headers onto your system now?

    Reply
    1. chris lea Post author

      You’d need to ask the node developers to be sure. But, I believe that you use npm to install node-gyp, and then use that to configure your modules. The official explanation (I believe) is on GitHub.

      Reply
    2. Dale Emmons (@dpemmons)

      We use a custom build system for our native module, so I ended up having to add all the node/v8/uv headers to our repo so they could be found:

      #SOURCES
      # —- uv —-
      wget https://github.com/joyent/libuv/blob/node-v0.10.1/include/uv.h

      # —- node —-
      wget https://raw.github.com/joyent/node/v0.10.1/src/node.h
      wget https://raw.github.com/joyent/node/v0.10.1/src/node_object_wrap.h

      #—- v8 —-
      wget https://raw.github.com/joyent/node/v0.10.1/deps/v8/include/v8.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/v8/include/v8stdint.h

      mkdir -p uv-private
      cd uv-private
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/ngx-queue.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/stdint-msvc2008.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/stdint-msvc2008.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/uv-bsd.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/uv-darwin.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/uv-linux.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/uv-sunos.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/uv-unix.h
      wget https://raw.github.com/joyent/node/v0.10.1/deps/uv/include/uv-private/uv-win.h

      Reply
  4. Tom

    Hi Chris,
    Thanks for your PPA! I followed your steps to upgrade to Node 0.10 on Ubuntu 12.04. However, “node -v” keeps on saying “v0.8.14”. Any ideas what I’m doing wrong?

    Reply
    1. chris lea Post author

      Hrm, unfortunately that really isn’t enough to go on definitively. I can tell you that if the output of

      which node
      

      doesn’t point to

      /usr/bin/node
      

      then you’re not using the node from my package. Specifically, if it’s pointing to

      /usr/local/bin/node
      

      or something like that, then there’s likely a previous install floating around that’s getting caught earlier on your $PATH. Hope this is helpful.

      Reply
      1. Tom

        Hi Chris,
        That’s exactly what was going on! I just had to remove the node version from the “local” folder and now your package is used.
        Thanks!

        Reply
    1. chris lea Post author

      I’m pretty sure Launchpad only generates repositories for official Ubuntu releases. I don’t know if just installing the raring package would work, but if the “olivia” release is based on raring I expect it should work fine.

      Reply
      1. JD

        Well… I changed to the official ubuntu/raring… Didn’t like Mint too much anyways 😉 Thanks… (And production is on 12.04 LTS, so it’s no big deal really)

        Reply
  5. Peter

    Hey Chris, thanks a lot for your packaging efforts. Unfortunately your Node PPA’s are currently not suitable for direct use in production, because of the way they are organized (one PPA always follows the stable version, another one follows stable minus 1). Most production deployments can’t afford to have e.g. 0.8.x automatically upgraded to 0.10.x when the stable branch changes. Such upgrades usually break various Node modules, and should always be tested by a human first.

    Because of this, I’ve been copying your packages into my PPA’s for some time, organized by branch:

    https://launchpad.net/~onestone/+archive/node.js-0.8
    https://launchpad.net/~onestone/+archive/node.js-0.10

    I think that’s a generally better structure. Major version upgrades should never happen automatically.

    Reply
    1. chris lea Post author

      I thought about doing a numbered scheme as well, but decided against it after talking to the guys in charge of Node. The reason is that they only plan on doing even security fixes for the main release series one back from whatever is current. Meaning that at the time of this writing, they aren’t touching the 0.6.x series anymore. Once the 0.12.x series lands, they won’t touch 0.8.x anymore. So just having the “current” releases in the node.js PPA, and the “one back” in node.js-legacy PPA is essentially an extra push / motivation for people to keep reasonably current (which is what they want).

      You are, of course, welcome to grab my packages and rebuild them into whatever repositories you see fit.

      Reply
      1. Peter

        I agree that one should upgrade to the next series (I myself did that), at least until Node 1.0 gets released (until then only the last stable series is fully supported with security patches). However, that can’t always happen immediately. For example, when Node 0.6 was released, a lot of popular modules broke, and some needed several days to release fixes. It was similar with 0.8 and 0.10. Also, upgrading to a new major version usually requires binary modules to be recompiled. That’s why I’m convinced that major upgrades shouldn’t be pushed forcefully.

        Reply
  6. Bruce Ingalls

    Run this, after every upgrade! (post-install script?)

    #!/bin/sh
    #npmCheck: test all npm modules. Run as root

    for i in /usr/lib/node_modules/*
    do cd $i
    npm test
    done

    Reply
    1. chris lea Post author

      That’s correct, I’m not currently building the 13.10 packages as the distro is still in alpha stage. I may reconsider this if there’s enough interest. Until then, I suspect that the binaries for Raring should work.

      Reply
  7. Bruce Ingalls

    I try to run `meteor test-packages` inside a clone of the https://github.com/alanning/meteor-roles project. Or any meteor project. Other environments successfully pass all 422 tests in about a minute. I run Ubuntu 12.04 with your PPA. I have reasonable hardware, but it takes 45 MINUTES to finally fail about 6 of the tests.
    Immediately, after upgrading from 0.10.10 to 0.10.12, I was able to fail these tests in only 8 minutes, but after a day, I’m back to failing them in 45 minutes again.
    The Meteor community does not know where the problem is. Perhaps because they use other Node distros?
    Any other Ubuntu Node users, with this problem?

    Reply
  8. David

    Hi Chris,
    Thanks for having the legacy repository for node 0.8 as that is what parsoid for the mediawiki visual editor requires. Before you remove this repository, could you please be sure that parsoid is no longer dependent on 0.8 of node?

    Many thanks,
    David

    Reply
    1. chris lea Post author

      As noted in the post, I’m going to track “one stable release back from current” in the -legacy PPA. This is at the request of the NodeJS developers. So when 0.12.x comes out, the 0.8.x line will get pulled from -legacy. If you need to keep a specific version, you can always copy the package into a PPA of your own that you maintain.

      Reply
    1. chris lea Post author

      Launchpad won’t let me replace newer versions of things with older versions. That said, there’s a new release coming out today to address this problem, and I’ll update my PPA as soon as the sources are available.

      Reply
  9. Pingback: A *Useful* HTTP Proxy Server in 66 Lines of node.js Code | Danny Ayers' Other Alternate Weblog

  10. Pingback: Installing Sass, Compass, nanoc 3.x and Foundation 5 • A Virtual Home

  11. Pingback: Installing Node.js via package manager - /BLOG

  12. Pingback: Установка Node.JS на Windows, Linux, BSD и установка из исходников

  13. Zannr

    ok im so glad i found this bog. i am trying to upgrade to the newest nodejs and im sorta confused. from what i understand npm is included in the node install right? if so, then i got that much correct. the next thing is that i am able to install 0.10.25 without any problems on my ubuntu 12.04. the problem is that when i try to run a simple app.js file it blows up with:

    zannr@zannr-1:~/devenv/nodeapps$ node app.js

    /home/zannr/devenv/nodeapps/app.js:1
    (function (exports, require, module, __filename, __dirname) { / Load the http
    ^
    SyntaxError: Invalid regular expression: missing /
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3
    zannr@zannr-1:~/devenv/nodeapps$

    from what i can tell its that it must have something to do with the npm not loading modules correctly, but im not sure how to fix it. im not sure if it has to do with the new npm integration with node or not. please help me… THANKS!

    Reply
  14. Pingback: Installing node.js | ltonz

  15. Pingback: Installing Node.js in Ubuntu & RHEL/CentOS via package manager | ModuleXploited

  16. Pingback: Creating Node.js web app with Express | ajduke's blog

  17. Pingback: Building your Ubuntu PHP development box on Azure using Vagrant - Thomas Conté's MSDN Blog - Site Home - MSDN Blogs

  18. Pingback: Getting Started With Node.js - Propellio

  19. Pingback: Installing Node.js in Ubuntu | JavaScript.sg

  20. Pingback: How to: How to keep up with the latest versions of NodeJS in Ubuntu ? PPA ? Compiling? | SevenNet

Leave a Reply