Ubuntu Sublime Text 2 Java Script compiling but not running

I'm setting up Sublime text 2 and running:

console.log("Hello!");

But all I'm getting in the console is "finished in [0.0]

My build system is:

{
"cmd": ["node", "$file"],
"selector": "source.js"
}

Any help would be greatly appreciated. This again is being done in Ubuntu.

The nodejs package for Ubuntu provides /usr/bin/nodejs, not /usr/bin/node. The node package, for amateur packet radio nodes, provides /usr/sbin/node, which is what your build system is running. It has nothing to do with Javascript, hence no output. There are two options (assuming you've already installed nodejs), and you can do one or both:

  1. From the command line, run

    sudo ln -s /usr/bin/nodejs /usr/local/bin/node
    

    This will create a symlink to node that (I think, I'm not in Ubuntu at the moment) should be before /usr/sbin in your $PATH. Run echo $PATH to verify the order of your path.

  2. Change your build system to run /usr/bin/nodejs instead of node. This will fix your immediate problem, but if you don't run the other command above you may have issues with Sublime's NodeJS plugin.

Good luck!