Download Node JS

Node JS is available for all desktop platforms like, Window, Mac and Linux. To install node js, just open the official side of node js and download node js for your platform. Or click the following link to Download Node JS as per your operating system.

Node JS for Windows, Mac and Linux

Node JS For Windows   Node JS For Mac   Node JS For Linux

Node JS Source Code

For Node JS source code or other binaries, please click link below

Node JS Source Code

The Stable version of Node JS is 18.16.0 (LTS) recommended for most users. However the latest version of Node JS is 20.2.0

Which version to download?

For most of the users, always prefer stable version of node js over current version. Current Version is the latest version, but its still under beta testing. That's why its not stable.

Node JS Stable versions are always in even numbers. Odd numbers are actually beta version for testing. Always build your app using Node JS Even version.


Check Node JS

To check whether Node JS is successfully downloaded or node, open Terminal or command prompt of your system and follow steps below.

  1. Open Terminal or Command Prompt. ( + R ) for windows and then type cmd.
  2. Type Node in terminal or cmd.
  3. If you see any output, that means node is installed.
  4. If you see any error, try installing node js again.

Check Node JS is installed or not?

Welcome to Node.js v18.14.1.

Type ".help" for more information.

node

Check Node JS Version

To Check Node JS version in terminal, type node --version or node -v. See example

v18.14.1.

node --version

v18.14.1.

node -v

Exit Node from Terminal

Once node is running in terminal, we cannot use terminal for other actions. to exit node from terminal, type .exit.

.exit

Get help from Terminal

.break    Sometimes you get stuck, this gets you out
.clear    Alias for .break
.editor   Enter editor mode
.exit     Exit the repl
.help     Print this help message
.load     Load JS from a file into the REPL session
.save     Save all evaluated commands in this REPL session to a file

Press ^C to abort current expression, ^D to exit the repl    
.help

Clear console

To clear console in nodejs , press clear in terminal.

clear

Node JS REPL

Node JS REPL, i.e Read-Eval-Print-Loop is Node JS Environment in terminal to run node js.

To start node repl, type node in terminal or command prompt.

node

Add numbers in repl

5
2+3

Hello world in repl

'hello world'
"hello world"

console.log in repl

hello node
undefined
console.log("hello node")

The default return value of all functions in JavaScript is undefined. That's why after printing hello node in console, undefined is returned as console.log is a function.


Run .js file in NodeJS REPL

To run a .js file in nodeJS REPL, use following commands. Suppose the name of file is hello.js saved on desktop.

    /*hello.js*/

console.log("hello node js");               
                

Change directory to desktop using cd Desktop command first, and then type following command in terminal.


hello node js

cd desktop

node hello