To add a simple Node build system to ST3 that will allow you to build (execute) JavaScript with Node straight from the editor.
Create the new build system.
Tools > Build System > New Build System...
Change the content to...
{
"cmd": ["node", "$file"]
}
... and save the file as "node.sublime-build". This will be saved in ~/.config/sublime-text-3/Packages/User/.
Tell your project to use the new build system. You can also add a selector to the build system json.
Tools > Build System > node
Now, whenever you want to execute the file with Node, hit ctrl+b.
There is some built in debugging, but it sucks. Instead, use Node Inspector which looks and acts like the browser debugger you're used to.
sudo npm install -g node-inspector
To run your app with Node Inspector...
node-debug ./your-app.js
Now, we can change the build system to use Node Inspector.
{
"cmd": ["node-debug", "$file"]
}
If you end up seeing EADDRINUSE when trying to build, it means it didn't shut down correctly last time. There are a number of ways to resolve this, including...
killall node
You can customize how Node Inspector runs with .node-inspectorrc.