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"
.
Add a comment
|
1 Answer
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.
-
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
-
-
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