0

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".

1 Answer 1

1

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

EDIT:

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.

3
  • What should I do if node.js is installed, but isn't showing up in the list of applications to choose from? Sep 16, 2012 at 22:21
  • Click the "Add" button. Sep 16, 2012 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? Sep 16, 2012 at 23:29

You must log in to answer this question.

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