Nodejs and NPM setup on Linux Mint



To install current version of Node js on Linux Mint or any Ubuntu derivatives

1. Install Node

    $ curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

2. Check Node version

   $ node -v
      vxx.xx.x
   $ npm -v
      x.x.x

3. Verify the Node installation

    var http = require('http');
    http.createServer(function (req, res) {
    res.writeHead(300, {'Content-Type': 'text/plain'});
    res.end('Hello World...!!!');
    }).listen(3001, "127.0.0.1");
    console.log('Server running at http://127.0.0.1:3001/');

   open your browser and type the URL http://127.0.0.1:3001/
   You can see the message “Hello World…!!!”

Source: 

Anil

Phasellus facilisis convallis metus, ut imperdiet augue auctor nec. Duis at velit id augue lobortis porta. Sed varius, enim accumsan aliquam tincidunt, tortor urna vulputate quam, eget finibus urna est in augue.

No comments: