Environment Setup

Local Environment Setup

Text Editor & The Node.js binary installable

Linux

Debian

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo ln -s /usr/bin/nodejs /usr/bin/node

Redhat

sudo yum install epel-release
sudo yum install nodejs
sudo yum install npm

Verify installation: Executing a File

: Create a JavaScript file named main.js on your machine (Windows or Linux) having the following code.

main.js

console.log("Hello, Node.js!")

Execute main.js file using Node.js interpreter to see the result

$node main.js

Result

Hello, Node.js!

Last updated