Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to set node.js as the default application on Ubuntu for opening .js files. How can this be done? Ideally, I'd like to be able to start a node.js server simply by double-clicking on a .js file, instead of navigating to the script's folder from the terminal and then typing "node name_of_script.js".

share|improve this question

Right-click on a .js file, open its properties, add node.js as an Open With application, and select it as the default.


It seems that newer versions of some DEs (yes GNOME, I'm looking at YOU...) have removed the option to do this. Using xdg-mime from the command line will tell you how to write the appropriate XML file to associate the application with the filetype, and how to associate it. See xdg-mime --manual for details.

share|improve this answer
What should I do if node.js is installed, but isn't showing up in the list of applications to choose from? – Anderson Green Sep 16 '12 at 22:21
Click the "Add" button. – Ignacio Vazquez-Abrams Sep 16 '12 at 22:55
I'm referring to the list of applications under "other applications." Node.js doesn't even show up there, so I can't add it using the "add" button. How can I get Node.js to show up under "other applications", since I installed it from source? – Anderson Green Sep 16 '12 at 23:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .