Kategorie: Linux

Installing Node.js in Ubuntu 20.04

Node.js is the runtime, which is used to run JavaScript code outside of web browsers, especially on the server side. It is typically used for backend development.
The process of installing Node.js from the official Ubuntu repository is the same, like installing any other package. It's easy and simple, and it installs the latest stable version available.

we are updating the repositories:

sudo apt update

Now just use the apt package manager, to install Node.js and Npm on Ubuntu 22.04:

sudo apt install nodejs npm

After the process is complete, you can use this command, to check, whether Node.js was successfully installed:

nodejs --version

If you want to install a specific version of Node.js, you should choose nvm (Node Version Manager), which is a bash script, which allows you to install and manage multiple versions of Node.js on the same server.

First of all, you need to install the nvm script. To install nvm, you can use curl or wget

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Close and reopen the terminal or run the command below, to download bash:

source ~/.bashrc

Now, to list all versions of Node.js available in nvm, use this command:

nvm list-remote

To install a specific version of Node.js on Ubuntu 22.04, use the command below:

nvm install [numerwersji]

to list all installed Node.js versions:

nvm ls

You can use the following command, to change the default Node.js version of your system:

nvm alias default [numerwersji]

To activate the Node.js version, use this command:

nvm use [numerwersji]

Linux

Udostępnij
Opublikowane przez
Linux

Recent posts

KeePass2 2.52 w Ubuntu 22.04

The guide below describes how to install KeePass on Ubuntu. Całość wykonamy za pomocą kilku poleceń

2 years temu

Installing Master PDF editor in Ubuntu 22.04

Master PDF Editor is a comprehensive PDF program, which includes many features. Oprócz tworzenia i edycji

2 years temu

iotop - memory monitoring

Iotop jest prostym narzędziem dla systemów Uniksowych umożliwiającym monitorowanie użycia dowolnego nośnika pamięci flash/hdd/ssd w

2 years temu

Run multiple commands in one cron job

You can separate two or more commands with semicolons (;), Semicolon (;): służy do oddzielania

2 years temu

Changing the exif data of a photo in the Linux terminal

Poniższy poradnik opisuje w jaki sposób za pomocą konsoli możemy dokonać edycji danych zdjęcia exif.

2 years temu

Installing Rocket.Chat Server on Rocky Linux 8

The following guide describes how to install Rocket.Chat on Rocky Linux 8 Całość bardzo prosto zainstalujemy

2 years temu