• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Node.js Installation

Node.js is a JavaScript-based platform, is an increasingly popular, lightweight, and efficient option for developers. It allows coders to use JavaScript on both the front-end and the back-end thanks to Google’s awesome V8 engine.

Installation

-Install Xcode.

-Install git.

-Run the following commands:

git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install

Debian (Ubuntu/ Mint)

With Aptitude package manager one can install the package nodeJS then edit their bash config to redirect the command node to node js.

sudo aptget update
sudo apt
get install nodejs
sudo apt
get install npm

nano (edit / vim) the file ~/.bashrc and add the line: alias node="nodejs"

Redhat (Fedora / CentOs)

Simply install from official repos:

sudo yum install nodejs npm

If that fails, enable EPEL repo:

curl --silent --location https://rpm.nodesource.com/setup | bash -

Then simply install from repo:

yum -y install nodejs 

Gentoo

In portage tree:

emerge nodejs

Archlinux

In official repo use pacman package manager:

pacman -S nodejs npm

Linux from source

-Install the dependencies ( Below example using debian apptitude package manager): g++ curl libssl-dev apache2-utils git-core build-essential

sudo apt-get install g++ curl libssl-dev apache2-utils git-core build-essential

 

-Run the following commands:

git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install

Interested in mastering Node.js Training? Enroll now for FREE demo on Node.js Training.

Windows

Currently, you must use cygwin to install node. To do so, follow these steps:

-Install cygwin.

-Use setup.exe in the cygwin folder to install the following packages:

-devel → openssl

-devel → g++-gcc

-devel → make

-python → python

-devel → git

-Open the cygwin command line with Start > Cygwin > Cygwin Bash Shell.

-Run the below commands to download and build node.

git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install

Hello Node.js!

Here’s a quick program to make sure everything is up and running correctly:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello Node.js\n');
}).listen(8124, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8124/');

Run the code with the node command line utility:

> node hello_node.js
Server running at http://127.0.0.1:8124/

Now, if you navigate to http://127.0.0.1:8124/ in your browser, you should see a nice message.

For indepth understanding click on

Node.JS Tutorials

Node.JS Interview Questions

Summary
Review Date
Reviewed Item
How to Install Node.js
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Node.js Installation"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.