1. Windows Installation:
- Open Node.js website
- Download LTS Version
- Open downloaded file
- Click Next
- Accept terms & conditions
- Click Install
- Click Finish
2. Ubuntu/Linux Installation:
Open Terminal
Run update command
sudo apt update
Install Nodejs
sudo apt install nodejs npm -y3. macOS Installation:
Open Terminal
Install Homebrew (if not installed)
Run command:
brew install nodeImportant Commands:
| Command | Use |
| node -v | Check Node.js version |
| npm -v | Check npm version |
| npm init | Create project |
| npm install | Install package |
Node.js Program:
app.js
// Add code in Program console.log("Hello Node.js");Run Program:
node app.jsOutput:
Hello Node.js