$ sudo apt install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
nodejs
1 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.
Need to get 24.7 MB of archives.
After this operation, 111 kB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_14.x focal/main amd64 nodejs amd64 14.8.0-deb-1nodesource1 [24.7 MB]
Fetched 24.7 MB in 20s (1,246 kB/s)
(Reading database ... 155976 files and directories currently installed.)
Preparing to unpack .../nodejs_14.8.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.8.0-deb-1nodesource1) over (14.7.0-deb-1nodesource1) ...
Setting up nodejs (14.8.0-deb-1nodesource1) ...
Processing triggers for man-db (2.9.1-1) ...
$ nodejs -v
Command 'nodejs' not found, but can be installed with:
sudo apt install nodejs
I used these commands before that
curl -sL https://deb.nodesource.com/setup_14.x | bash - apt-get install -y nodejs