Download from https://nodejs.org. Install with default options. To check, type the following on the terminal
$ which node
If you see a path like the following, nodejs is installed and you can start coding:
Type the following command in your non-formatting editor of choice such as sublimetext or nodepad++.
Save this file as hello.js. Type the following command to run the code:
$ node hello.js