How to install and manage Node using NVM on Godaddy Server ?
GoDaddy VPS is a shared server that provides computational services, databases, storage space, automated weekly backups, and 99% uptime, and GoDaddy Server is a cloud-based hosting platform that consists of virtual and dedicated servers.
The premium service includes weekly backups, 99% uptime, 24×7 Customer Support, a free encrypted SSL certificate, unlimited bandwidth, and SSD storage. For regular users, the latest generation is VPS Gen 4, which uses QEMU as the hypervisor to perform hardware virtualization. It offers a cheaper alternative to Amazon Web Service and Google Cloud Platform.
So, to install and manage different versions of Node, we will use Node Version Manager. NVM is an open-source tool that allows you to download, configure, and run different versions of Node.js on the same machine.
In this article, we will discuss how to install the latest version of Node and NPM on GoDaddy VPS Gen 4 (Ubuntu).
Step 1: Open your terminal by searching it in the application Menu and ssh into the Godaddy server.
$ ssh [username]@[ip]
Step 2: Update and upgrade the server by running.
$ sudo apt update -y $ sudo apt upgrade -y
Step 3: Install the latest version of nvm by executing the required bash script.
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Step 4: Now, open the .bashrc file and append the path variables to the end of the file
$ nano ~/.bashrc
Step 5: Now, set the path for the NVM home directory by pasting the following at the end of the file.
[ -s “$NVM_DIR/nvm.sh” ] && \. “$NVM_DIR/nvm.sh” # This loads nvm
[ -s “$NVM_DIR/bash_completion” ] && \. “$NVM_DIR/bash_completion” # This loads nvm bash_completion
Step 6: Commit the changes by reloading the .bashrc file.
$ source ~/.bashrc
Step 7: Verify if nvm has been installed on the server successfully
$ nvm --version
Installing Node and NPM:
Step 1: Install the latest version of node and npm by running
$ nvm install node
Step 2: Verify the installation by checking the build version of node and npm
$ node --version $ npm --version
Managing Node versions:
Step 1: To install an older version of the node.
$ nvm install [version]
Step 2: To use the newly installed version.
$ nvm use [version]
Step 3: Set a specific version as default.
$ nvm alias default [version]
Step 4: Remove an existing version by running.
$ nvm uninstall [version]
Using Node JS:
$ node filename.js
Please Login to comment...