Developing Node.js with Atom Editor

Recently I have been playing with Node.js and for every developer, getting the perfect IDE/Editor and setting up the workspace is very important. Here’s how I got my set up ready:

I am using Xubuntu 14.04.3 LTS. So the steps that I am going to share will work in any of the Ubuntu flavours.

1. Installing Node.js: Node.js is already there in the default Ubuntu 14.04 repository and the version is 0.10.25. If you need more updated version, you have 2 ways. You can either download it from the official Node.js site, or you can follow this tutorial and add a third-party repository or use nvm to get it installed. In the first case, it will not be auto-updated though. However, I chose to use the default repository version as I didn’t see the point in going through all these hassle unless I specifically want a feature that is only available in the newer versions.

To install the default nodejs in Ubuntu 14.04, type the below command (or use your favourite package manager to install the package):

sudo apt-get install nodejs

2. Installing Atom editor: While this is something that is not exactly required for Node.js and Node.js can be developed with any editor, I preferred Atom for it’s set of features and open source nature. To install Atom on my system, I used the WebUpd8 PPA so that I get regular updates and I don’t need to build from source to install the latest one. To use the WebUpd8 PPA, use the below commands:

sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom

For further information, visit the WebUpd8 site. You can also download the latest version of the software from Atom official site.

3. Configuring Atom to run Node within Atom: While you can write your code in Atom and run it from the terminal separately, I prefer to run it within the IDE itself, it saves a lot of Alt + Tab. It’s not supported by default, you need to add a package to get this functionality.

Open Atom and go to Edit -> Preferences -> Install. Search for the package atom-runner and hit Install. Atom-runner will now be installed. Although you need to change the default configuration to run Node using atom-runner. The reason is that in Ubuntu, the name of the Node.js package (hence the command) is not node (it is the default everywhere else) due to the conflict with some other package, rather it’s nodejs.

To update the configuration, open ~/.atom/config.cson with your favourite text editor where ~ stands for your home directory. Paste the below lines:




Do take care of the indentation. The first line of the above text should be indented a little right and the next two lines should each be indented further right.

If you do the above steps correctly, you have your Atom editor ready to write some Node. Create a new file and name it to somename.js. Paste console.log(‘It’s working.’) in the editor and save it. Press Alt + R and it should print the output in a new tab.

That’s it for now. I will be adding more contents to it as I go with Node. Let me know in the comments if you have better suggestions about Node.js development. I will be sure to take a look.

If you are looking into ways of tuning your Atom editor to be better suited for coding Javascript with the features like content-assist, go through this post about The Perfect Javascript Editor.


I am a software engineer, an open-source enthusiast and a hobbyist blogger.

Tagged with: , , , , , , , ,
Posted in Blog, HowTos, Javascript, Node.js, Ubuntu
8 comments on “Developing Node.js with Atom Editor
  1. This tutorial, in the part of atom-runner configuration for ubuntu, doesn’t works.

  2. Tai Truong says:

    Just a note here. I had the same problem with the configuration by copy-pasting these 3 lines above. The error is that the code above does not contain double-quotes ” but ” in line 3: js:”nodejs”

  3. Kast says:

    Unfortunately the config.cson solution did not work for me. The setting seems to have no effect at least on Atom 1.7.2 + atom-runner 2.6.0. I’ve re-entered and double-checked everything by hand without copy-pasting.

    This one worked in my case:

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

    It’s a bit dirty though. Also, you have to make sure /usr/local/bin is in your PATH though.

    Some people also suggest using update-alternatives for that.

  4. Nicholas Reed says:

    when you paste in the config file, paste this instead:


    You forgot the parenthesis

  5. nicenicenice says:

    Thanks a lot! Worked for me, i just took care of two things : 1.Correct indentation 2.)removed the inverted commas which were looking bit different and used double inverted commas 3.)pasted at last saved it and it worked..
    I have one question : How to close the nodejs server because Control+C in terminal inside atom don’t work 😦

  6. None says:

    Did this on Windows too – worked for me but the js:”nodejs” line needed to be js:”node” to get it working

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: