Many corporations use Node.js to give their website a better performance. This type of technology is widely used by developers, as it facilitates their work on the networks. You may have heard of Node.js and want to install it or maybe you already have it and want to update it. Here we ‘ll show có install or update mo NodeJS in Ubuntu easily and quickly.
It was created with the purpose of being practical for the creation of network programs, for example web servers. Its founder was Ryan Dahl in 2009 and its development was sponsored by the Joyent company. Node.js technology is well known and used by developers to optimize any Web application.
How to install or update Node.js on Ubuntu
Before installing Node.js it is important to access your server and run commands using sudo. Installing Node.js in Ubuntu is easy when you do it from an official repository. Proceed with the following steps:
- In the Ubuntu system you must open a terminal emulator from the main menu; once connected, mitigate the APT cache and perform the following command: sudo apt upadate.
- Carrying out this process ensures that the repository is synchronized and the system safely downloads what is stored in them.
- Then you can do the Node.js installation by doing the following command: sudo apt install nodejs.
- Afterwards, you must enter the password and in this way the installation process will start. Additionally, you have the option to install NPM, a Node.js package manager. Which can be done through this command: sudo apt install npm.
- To verify the installation you must run this command: node.js -v.
- In case you want to remove Node.js, do the following command: sudo apt remove nodejs.
Install or update Nodejs on Ubuntu from NVW
There are other ways to install Node.js on an Ubuntu 18.04 server , using an NWN. To install, you can select a specific version. Follow the next steps:
- You must download NWM using wget; In the case of not being sure to use wget, carry out the following command: sudo apt install wget
- Then proceed with this command: wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
- For the NWM to be used from the bash profile on your user, carry out the following command: source ~ / .profile
- Once ready, you can use NWM and show the Node.js versions to install: nvm ls-remote
- There you can choose the one you want. For better stability and support, version 10.15.1 is recommended. For that you must run this command: nvm install 10.15.1
- To make sure Node.js is installed, run this command: node -v.
Now, you can start using Node.js in Ubuntu. In case you want to uninstall it, deactivate it first with this command: nvm deactivate. Then you can uninstall Node.js with this one: nvm uninstall v10.15.1
As you can see, installing or updating Node.js in Ubuntu is a very simple and quite fast process, as long as you do it from an official site.
In addition, having this technology will allow you to improve any type of Web application. When downloading Node.js in Ubuntu, make sure you type the commands correctly and follow the steps we describe in this article to avoid any inconvenience.
We hope you liked this post, write your comments. Your opinion is important to us, it helps us to improve our content. Remember to use appropriate language and share this information with family and friends.