banner



How To Install Latest Nodejs On Ubuntu

Node.js is a platform built on Chrome's JavaScript runtime for hands building fast, scalable network applications. Latest version node.js ppa is maintaining by its official website. We can add this PPA to your Ubuntu 21.ten, 20.04 LTS, 18.04 LTS, xvi.04 LTS (Trusty Tahr) and 14.04 LTS (Xenial Xerus) systems and install node.js on Linux VPS with easy commands.

To install specific nodejs version, Visit our tutorial Install Specific Nodejs Version with NVM.

Install latest node.js on Ubuntu

Step 1 – Add Node.js PPA

Node.js packet is available in the LTS release and the current release. It's your choice to select which version you want to install on the arrangement as per your requirements. Allow's add the PPA to your system to install Nodejs on Ubuntu.

Use Current Release – During the terminal update of this tutorial, Node.js 16 is the current Node.js version available.

          sudo apt-become install roll                    gyre -sL https://deb.nodesource.com/setup_17.x | sudo -E fustigate -                  

Use LTS Release – Instead of electric current release, its good idea to employ stable version. During the terminal update of this tutorial, Node.js xiv is the latest LTS release available.

          sudo apt-get install ringlet                    coil -sL https://deb.nodesource.com/setup_16.ten | sudo -Due east fustigate -                  

For this tutorial, I am using the latest electric current release and added their PPA to my system.

Footstep 2 – Install Node.js on Ubuntu

You can successfully add Node.js PPA to the Ubuntu system. At present execute the beneath control install Node on and Ubuntu using apt-get. This will also install NPM with node.js. This command also installs many other dependent packages on your organisation.

          sudo apt-get install nodejs                  

That's information technology. This will install Node.js on your Ubuntu system.

Pace 3 – Check Node.js and NPM Version

After installing node.js verify and check the installed version. You can find more details about current version on node.js official website.

                      node -v                                v16.14.0        

Also, bank check the npm version

                      npm -v                                7.13.0        

Step iv – Create Demo Web Server (Optional)

This is an optional step. If you lot want to test your node.js install. Let's create a spider web server with "Hello World!" text. Create a file server.js

          sudo nano server.js                  

and add the post-obit content

server.js

var http = require('http'); http.createServer(function (req, res) {   res.writeHead(200, {'Content-Blazon': 'text/evidently'});   res.end('Hello Globe\north'); }).mind(3000, "127.0.0.1"); console.log('Server running at http://127.0.0.one:3000/');        

Salve the file and close. Then start the Node application using the following command.

                      node server.js                    debugger listening on port 5858 Server running at http://127.0.0.1:3000/        

Y'all can also start the application with debugging enabled with the following commands.

                      node --inspect server.js                    Debugger listening on ws://127.0.0.one:9229/938cf97a-a9e6-4672-922d-a22479ce4e29 For help, see: https://nodejs.org/en/docs/inspector Server running at http://127.0.0.1:3000/        

The web server has been started on port 3000. At present access http://127.0.0.one:3000/ URL in browser. Now you will need to configure a front-stop server for your app.

Conclusion

This tutorial helped yous to install the Latest Node.js version on an Ubuntu system. Besides provides you instructions to install the Latest stable Node.js version on Ubuntu.

Next, you may similar our tutorial: How to Setup Nginx every bit Frontend Server for Node.js

Source: https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/

Posted by: belltheirturavid.blogspot.com

0 Response to "How To Install Latest Nodejs On Ubuntu"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel