Setup Node.JS

Installing Node

On Ubuntu you can install Node.JS from the command line using apt-get.

You should already have it installed on your laptop if you completed the codeX intro.

The installation instructions are as follows:

Open a terminal window:

Now you are ready to use JavaScript from the command line.

Node.JS JavaScript from the command line

Let’s create a JavaScript file and run it from the command line:

So what happened? You liberated your JavaScript knowledge from the command line.

Now prove this to yourself and write some JavaScript that uses:

If you can, create about 5 different JavaScript (.js) files to get more comfortable with JavaScript on the command line.

You can run the scripts using nodejs filename.js