Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.