Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Set Node.js to $PATH (Ubuntu 12.04)

Set Node.js to $PATH (Ubuntu 12.04)

Problem

I am studying RoR and I am setting this virtual machine to "deploy" RoR and I got stuck in the Node.js installation.

I am using Ubuntu 12.04 and I followed this step of this guide:

http://railsapps.github.com/installing-rails.html

Since Rails 3.1, a JavaScript runtime has been needed for development on Ubuntu Linux (it is not needed for Mac OS X or Windows). For development on Linux Ubuntu, it is best to install the Node.js server-side JavaScript environment:

$ sudo apt-get install nodejs

and set it in your $PATH.

What does it mean, "set to my $PATH"?

I've been searching for it on google in the last couple of hours and all solutions are different, for different problems and I get no simple answer for that. Can you give a little light here?

Thanks!

Problem courtesy of: Apollo

Solution

You don't have to worry about that, the apt-get install command will do that for you. It adds the path to the nodejs process (usually /usr/bin/node) to the global $PATH variable. This ensures that when you type node in your terminal it will start the nodejs process.

If for some weird reason you cannot start it, you'll have to manually add the path to your node installation to the $PATH. You can do this by editing your ~/.bashrc file and adding:

PATH=/usr/bin/node:$PATH
Solution courtesy of: mihai

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Set Node.js to $PATH (Ubuntu 12.04)

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×