Lets Install And Get Started With Node.JS

Lets Install And Get Started With Node.JS

Installation Process

  1. Search on Google: install node

  2. Click on Link https://nodejs.org/en/download/

  3. Choose either LTS or Current depending on you i.e. you want the latest features by choosing the Current one or old features that already worked and reviewed.

  4. After clicking on window Installer you see its started downloading

  5. Click on next

  6. Read and Accept term in the license Agreement and click next

  7. Click next

  8. Click next

  9. Choose checkBox and click next

  10. Installation started and after installation click finish

  1. After clicking on finish one terminal popup to install chocolatey please press any Key from Keyboard to continue

  1. After clicking any key from keyboard, PowerShell opened and waits for 5minute until options come TYPE ENTER to exit

  1. Type Enter and you are done

How to Check Whether node.JS is installed or not in your system?

Follows Steps

  1. Open VS code and then create index.html file and nodetesting.js file and then write this code below
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <h1>Hello, world!</h1>
  </body>
</html>const http = require('http')
const fs = require('fs')
http.createServer((req, res) => {
  fs.readFile('index.html', (err, data) => {
    res.writeHead(200, {'Content-Type': 'text/html'})
    res.write(data)
    res.end()
  })
}).listen(8000)
  1. Open Terminal of vs code and write on terminal node nodetesting.js and Hit Enter

  2. Open chrome browser using open with Live server extension and you can see a similar

  3. Finally, You are done with server-side programming. Congrats!