Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Installation and creating basic project using nodeJS.(Chapter 1)

    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 500
    Comment on it

    NodeJS is an open source, completely free and javascript based platform built on Google Chrome's JavaScript V8 Engine. In other words we can say that NodeJS is a cross platform which is used to develop server side web application.

    Installation and use of NodeJS:

    Before starting NodeJS we have to install npm and expressJS. NPM is used to install all the dependencies and module which is required while creating new project. So for Installing NPM, go to the terminal and type following command.


    For installing NPM


    sudo apt-get install npm

    So after installing npm we will install expressJS. Command to install expressJS is as follow.


    For installing Express


    npm install -g express
    npm install -g express-generator


    Now we will install NodeJS .For this we will write following command.

    kedar@kedar:~$ mkdir project_folder_name
    kedar@kedar:~$ cd project_folder_name/
    kedar@kedar:~/project_folder_name$ ls
    kedar@kedar:~/project_folder_name$ express myApp


    //After that have to install the dependencies
    To Install dependencies

    npm Install        (This command is use to install all the dependencies that are present in package.json.)


     By this, we are ready to work in nodeJS.

    Now we will define the server. For this, we will write the following code in app.js

    //node js server
    var port     = process.env.PORT || 7000;
    var http = require('http')
    var server = http.createServer(app)
    console.log('Listening  to  port ' + port);


    Here in the above code, we have to write how we will define the server. Now our code will start running on the following URL .


    Now we will start the server by using following command

    Node app.js

    Here all the installation and basic application of nodeJS and expressJS  is ready to work.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: