1. Windows Installation:

  1. Open Node.js website
  2. Download LTS Version
  3. Open downloaded file
  4. Click Next
  5. Accept terms & conditions
  6. Click Install
  7. Click Finish

2. Ubuntu/Linux Installation:

Open Terminal
Run update command

sudo apt update

Install Nodejs

sudo apt install nodejs npm -y

3. macOS Installation:

Open Terminal
Install Homebrew (if not installed)
Run command:

brew install node

Important Commands:

CommandUse
node -vCheck Node.js version
npm -vCheck npm version
npm initCreate project
npm installInstall package

Node.js Program:

app.js

// Add code in Program console.log("Hello Node.js");

Run Program:

node app.js

Output:

Hello Node.js