Step 1: Install NodeJS
apt-get install nodejs -y
Result:
root@tutorialspots:~# apt-get install nodejs -y Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: linux-headers-5.13.0-19 linux-headers-5.13.0-19-generic linux-image-5.13.0-19-generic linux-modules-5.13.0-19-generic Use 'apt autoremove' to remove them. The following additional packages will be installed: javascript-common libc-ares2 libjs-highlight.js libnode72 nodejs-doc Suggested packages: npm The following NEW packages will be installed: javascript-common libc-ares2 libjs-highlight.js libnode72 nodejs nodejs-doc 0 upgraded, 6 newly installed, 0 to remove and 24 not upgraded. Need to get 12.3 MB of archives. After this operation, 51.2 MB of additional disk space will be used. Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu impish/main amd64 javascript-common all 11+nmu1 [5936 B] Get:2 http://nova.clouds.archive.ubuntu.com/ubuntu impish/universe amd64 libjs-highlight.js all 9.18.5+dfsg1-1 [367 kB] Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu impish/main amd64 libc-ares2 amd64 1.17.1-1ubuntu1 [44.5 kB] Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu impish/universe amd64 libnode72 amd64 12.22.5~dfsg-5ubuntu1 [9300 kB] Get:5 http://nova.clouds.archive.ubuntu.com/ubuntu impish/universe amd64 nodejs-doc all 12.22.5~dfsg-5ubuntu1 [2506 kB] Get:6 http://nova.clouds.archive.ubuntu.com/ubuntu impish/universe amd64 nodejs amd64 12.22.5~dfsg-5ubuntu1 [122 kB] Fetched 12.3 MB in 3s (3844 kB/s) Selecting previously unselected package javascript-common. (Reading database ... 129595 files and directories currently installed.) Preparing to unpack .../0-javascript-common_11+nmu1_all.deb ... Unpacking javascript-common (11+nmu1) ... Selecting previously unselected package libjs-highlight.js. Preparing to unpack .../1-libjs-highlight.js_9.18.5+dfsg1-1_all.deb ... Unpacking libjs-highlight.js (9.18.5+dfsg1-1) ... Selecting previously unselected package libc-ares2:amd64. Preparing to unpack .../2-libc-ares2_1.17.1-1ubuntu1_amd64.deb ... Unpacking libc-ares2:amd64 (1.17.1-1ubuntu1) ... Selecting previously unselected package libnode72:amd64. Preparing to unpack .../3-libnode72_12.22.5~dfsg-5ubuntu1_amd64.deb ... Unpacking libnode72:amd64 (12.22.5~dfsg-5ubuntu1) ... Selecting previously unselected package nodejs-doc. Preparing to unpack .../4-nodejs-doc_12.22.5~dfsg-5ubuntu1_all.deb ... Unpacking nodejs-doc (12.22.5~dfsg-5ubuntu1) ... Selecting previously unselected package nodejs. Preparing to unpack .../5-nodejs_12.22.5~dfsg-5ubuntu1_amd64.deb ... Unpacking nodejs (12.22.5~dfsg-5ubuntu1) ... Setting up javascript-common (11+nmu1) ... apache2_invoke: Enable configuration javascript-common Setting up libc-ares2:amd64 (1.17.1-1ubuntu1) ... Setting up libnode72:amd64 (12.22.5~dfsg-5ubuntu1) ... Setting up libjs-highlight.js (9.18.5+dfsg1-1) ... Setting up nodejs (12.22.5~dfsg-5ubuntu1) ... update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Setting up nodejs-doc (12.22.5~dfsg-5ubuntu1) ... Processing triggers for man-db (2.9.4-2) ... Processing triggers for libc-bin (2.34-0ubuntu3) ... Scanning processes... Scanning linux images... Running kernel seems to be up-to-date. No services need to be restarted. No containers need to be restarted. No user sessions are running outdated binaries.
Step 2: install npm
apt-get install npm -y
Result:
... Preparing to unpack .../298-node-tunnel-agent_0.6.1-2_all.deb ... Unpacking node-tunnel-agent (0.6.1-2) ... Selecting previously unselected package node-request. Preparing to unpack .../299-node-request_2.88.1-5_all.deb ... Unpacking node-request (2.88.1-5) ... Selecting previously unselected package npm. Preparing to unpack .../300-npm_7.5.2+ds-2_all.deb ... Unpacking npm (7.5.2+ds-2) ... Setting up node-forever-agent (0.6.1-2) ... Setting up node-qs (6.9.4+ds-1) ... Setting up node-delayed-stream (1.0.0-4) ... Setting up node-isstream (0.1.2+dfsg-1.1) ... Setting up node-builtins (1.0.3-2) ... Setting up fonts-tlwg-garuda-ttf (1:0.7.2-1build1) ... Setting up libuv1-dev:amd64 (1.40.0-2ubuntu1) ... Setting up libxcb-dri3-0:amd64 (1.14-3ubuntu1) ... Setting up node-colors (1.4.0-1) ... Setting up node-fs.realpath (1.0.0-1.1) ... Setting up fonts-tlwg-laksaman-ttf (1:0.7.2-1build1) ... Setting up node-oauth-sign (0.9.0-2) ... Setting up libx11-xcb1:amd64 (2:1.7.2-1) ... Setting up node-jsbn (1.1.0-1.1) ... Setting up libpciaccess0:amd64 (0.16-1build3) ... Setting up node-object-assign (4.1.1-3) ... Setting up node-extsprintf (1.4.0-1) ... Setting up node-leven (3.1.0+~cs1.1.1-1) ... Setting up libdrm-nouveau2:amd64 (2.4.107-8ubuntu1) ... Setting up node-abbrev (1.1.1-2) ... Setting up node-puka (1.0.1+dfsg-2) ... Setting up libtie-ixhash-perl (1.23-2.1) ... Setting up fonts-arundina (0.3.2-1) ... Setting up libxcb-xfixes0:amd64 (1.14-3ubuntu1) ... Setting up node-yallist (4.0.0-1) ... Setting up libjs-inherits (2.0.4-2) ... Setting up node-ansi-regex (5.0.0-1) ... Setting up libxi6:amd64 (2:1.7.10-1build2) ... Setting up libfont-afm-perl (1.20-3) ... Setting up libxrender1:amd64 (1:0.9.10-1build2) ... Setting up libnode-dev (12.22.5~dfsg-5ubuntu1) ... Setting up fonts-tlwg-loma-ttf (1:0.7.2-1build1) ... Setting up node-slash (3.0.0-1) ... Setting up node-util-deprecate (1.0.2-1) ... Setting up node-retry (0.12.0-1) ... Setting up node-concat-map (0.0.1-2) ... Setting up libclone-perl (0.45-1build1) ... Setting up libdrm-radeon1:amd64 (2.4.107-8ubuntu1) ... Setting up libglvnd0:amd64 (1.3.3-1) ... Setting up node-assert-plus (1.0.0-2) ... Setting up node-ansistyles (0.1.3-2) ... Setting up libio-stringy-perl (2.111-3) ... Setting up node-delegates (1.0.0-2) ... Setting up libhtml-tagset-perl (3.20-4) ... Setting up node-depd (2.0.0-1) ... Setting up libauthen-sasl-perl (2.1600-1.1) ... Setting up libxcb-glx0:amd64 (1.14-3ubuntu1) ... Setting up node-isexe (2.0.0-5) ... Setting up node-jsonparse (1.3.1-7) ... Setting up libdrm-intel1:amd64 (2.4.107-8ubuntu1) ... Setting up liblwp-mediatypes-perl (6.04-1) ... Setting up node-tweetnacl (1.0.3+dfsg-1) ... Setting up node-escape-string-regexp (4.0.0-1) ... Setting up node-through (2.3.8+~cs0.0.30-1) ... Setting up libxcb-shape0:amd64 (1.14-3ubuntu1) ... Setting up x11-common (1:7.7+22ubuntu2) ... Setting up libtry-tiny-perl (0.30-1) ... Setting up libsensors-config (1:3.6.0-7) ... Setting up libxxf86dga1:amd64 (2:1.1.5-0ubuntu2) ... Setting up perl-openssl-defaults:amd64 (5) ... Setting up node-aws-sign2 (0.7.1-2) ... Setting up node-color-name (1.1.4+~1.1.1-1) ... Setting up libencode-locale-perl (1.05-1.1) ... Setting up node-console-control-strings (1.1.0-2) ... Setting up fonts-tlwg-typo-ttf (1:0.7.2-1build1) ... Setting up fonts-tlwg-kinnari-ttf (1:0.7.2-1build1) ... Setting up libxcb-shm0:amd64 (1.14-3ubuntu1) ... Setting up node-uuid (8.3.2+~8.3.0-4) ... Setting up xiterm+thai (1.10-2build1) ... update-alternatives: using /usr/bin/txiterm to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode Setting up node-extend (3.0.2-1) ... Setting up node-jsonstream (1.3.5-1) ... Setting up node-aws4 (1.11.0-1) ... Setting up node-indent-string (4.0.0-1) ... Setting up node-dashdash (2.0.0-1) ... Setting up node-function-bind (1.1.1+repack-1) ... Setting up libxxf86vm1:amd64 (1:1.1.4-1build1) ... Setting up node-clone (2.1.2-2) ... Setting up node-p-map (4.0.0-1) ... Setting up node-iferr (1.0.2-1) ... Setting up node-chownr (1.1.3-5) ... Setting up node-has-flag (4.0.0-1) ... Setting up node-validate-npm-package-name (3.0.0-1.1) ... Setting up libxcb-present0:amd64 (1.14-3ubuntu1) ... Setting up libjs-psl (1.8.0+ds-4) ... Setting up node-json-schema-traverse (1.0.0-2) ... Setting up node-asap (2.0.6-2) ... Setting up node-mime (2.5.0+dfsg+~cs3.90.0-1) ... Setting up node-inherits (2.0.4-2) ... Setting up node-path-is-absolute (2.0.0-1) ... Setting up node-universalify (2.0.0-2) ... Setting up node-ini (2.0.0-1) ... Setting up node-iconv-lite (0.5.1-3) ... Setting up libfontenc1:amd64 (1:1.1.4-1build2) ... Setting up node-ecc-jsbn (0.2.0-2) ... Setting up node-safe-buffer (5.2.1+~cs2.1.2-1) ... Setting up node-promise-inflight (1.0.1-1.1) ... Setting up fonts-tlwg-umpush-ttf (1:0.7.2-1build1) ... Setting up node-combined-stream (1.0.8-1) ... Setting up fonts-tlwg-kinnari (1:0.7.2-1build1) ... Setting up node-json-stringify-safe (5.0.1+repack-3) ... Setting up node-json-parse-better-errors (1.0.2+~2.3.1-1) ... Setting up node-fast-deep-equal (3.1.3-1) ... Setting up node-har-schema (2.0.0-4) ... Setting up node-mime-types (2.1.28-1) ... Setting up node-performance-now (2.1.0+debian-1.1) ... Setting up node-err-code (2.0.3+dfsg-1) ... Setting up libdata-dump-perl (1.23-1.1) ... Setting up node-resolve-from (5.0.0+~3.1.0+~3.3.0+~2.0.0-1) ... Setting up fonts-tlwg-laksaman (1:0.7.2-1build1) ... Setting up libxfixes3:amd64 (1:5.0.3-2build1) ... Setting up libxcb-sync1:amd64 (1.14-3ubuntu1) ... Setting up libipc-system-simple-perl (1.30-1) ... Setting up node-balanced-match (1.0.0-1) ... Setting up libxml-xpathengine-perl (0.14-1) ... Setting up node-ansi (0.3.1-1) ... Setting up node-brace-expansion (2.0.0-1) ... Setting up libllvm12:amd64 (1:12.0.1-8build1) ... Setting up node-spdx-exceptions (2.3.0-1) ... Setting up xfonts-encodings (1:1.0.5-0ubuntu1) ... Setting up libxinerama1:amd64 (2:1.1.4-2build2) ... Setting up node-strip-ansi (6.0.0-2) ... Setting up node-set-blocking (2.0.0-1.1) ... Setting up libxv1:amd64 (2:1.0.11-1) ... Setting up fonts-tlwg-sawasdee-ttf (1:0.7.2-1build1) ... Setting up node-tunnel-agent (0.6.1-2) ... Setting up libio-html-perl (1.004-2) ... Setting up node-npm-bundled (1.1.1-1) ... Setting up libxrandr2:amd64 (2:1.5.2-0ubuntu1) ... Setting up node-signal-exit (3.0.3-1) ... Setting up libsensors5:amd64 (1:3.6.0-7) ... Setting up node-which (2.0.2+~cs1.3.2-1) ... Setting up fonts-tlwg-typist-ttf (1:0.7.2-1build1) ... Setting up node-wrappy (1.0.2-1.1) ... Setting up libglapi-mesa:amd64 (21.2.2-1ubuntu1) ... Setting up node-text-table (0.2.0-2) ... Setting up node-asynckit (0.4.0-3) ... Setting up libvulkan1:amd64 (1.2.162.0-1build1) ... Setting up node-ip (1.1.5-5) ... Setting up node-punycode (2.1.1-3) ... Setting up libtimedate-perl (2.3300-2) ... Setting up libxcb-dri2-0:amd64 (1.14-3ubuntu1) ... Setting up node-defaults (1.0.3-2) ... Setting up node-mute-stream (0.0.8-2) ... Setting up libjs-typedarray-to-buffer (4.0.0-1) ... Setting up node-number-is-nan (2.0.0-1) ... Setting up fonts-tlwg-typewriter-ttf (1:0.7.2-1build1) ... Setting up node-graceful-fs (4.2.4+repack-1) ... Setting up libxshmfence1:amd64 (1.3-1build3) ... Setting up libxcb-randr0:amd64 (1.14-3ubuntu1) ... Setting up node-jsonify (0.0.0-1.1) ... Setting up node-json-stable-stringify (1.0.1+~cs5.1.32-1) ... Setting up fonts-tlwg-garuda (1:0.7.2-1build1) ... Setting up node-aproba (2.0.0-1) ... Setting up fonts-tlwg-norasi-ttf (1:0.7.2-1build1) ... Setting up fonts-tlwg-waree-ttf (1:0.7.2-1build1) ... Setting up node-ip-regex (4.3.0-1) ... Setting up node-spdx-license-ids (3.0.7-1) ... Setting up node-string-decoder (1.3.0-2) ... Setting up node-mkdirp (1.0.4+~1.0.1-1) ... Setting up fonts-tlwg-loma (1:0.7.2-1build1) ... Setting up node-run-queue (2.0.0-1) ... Setting up node-core-util-is (1.0.2-2) ... Setting up node-json-schema (0.3.0+~7.0.6-1) ... Setting up node-uri-js (4.4.0+dfsg-5) ... Setting up node-minimatch (3.0.4+~3.0.3-1) ... Setting up libxkbfile1:amd64 (1:1.1.0-1build1) ... Setting up node-archy (1.0.0-3) ... Setting up fonts-tlwg-purisa-ttf (1:0.7.2-1build1) ... Setting up fonts-tlwg-mono-ttf (1:0.7.2-1build1) ... Setting up node-caseless (0.12.1-1) ... Setting up node-imurmurhash (0.1.4-1.1) ... Setting up node-verror (1.10.0-1.1) ... Setting up node-getpass (0.1.7-1.1) ... Setting up node-encoding (0.1.13-1) ... Setting up node-read (1.0.7-2) ... Setting up node-nopt (5.0.0-1) ... Setting up libxcomposite1:amd64 (1:0.4.5-1) ... Setting up node-asn1 (0.2.3-2) ... Setting up xdg-utils (1.1.3-2ubuntu2) ... Setting up node-color-convert (1.9.3-1) ... Setting up liburi-perl (5.08-1) ... Setting up libx11-protocol-perl (0.56-7.1) ... Setting up node-isarray (2.0.5-1) ... Setting up node-osenv (0.1.5-1) ... Setting up fonts-tlwg-typewriter (1:0.7.2-1build1) ... Setting up node-ms (2.1.3+~cs0.7.31-1) ... Setting up libjs-is-typedarray (1.0.0-3) ... Setting up libdrm-amdgpu1:amd64 (2.4.107-8ubuntu1) ... Setting up node-process-nextick-args (2.0.0-1) ... Setting up node-has-unicode (2.0.1-2) ... Setting up node-fs-write-stream-atomic (1.0.10-4) ... Setting up gyp (0.1+20200513gitcaa6002-2) ... Setting up libwayland-client0:amd64 (1.19.0-2build1) ... Setting up libnet-ssleay-perl (1.88-3ubuntu1) ... Setting up mesa-vulkan-drivers:amd64 (21.2.2-1ubuntu1) ... Setting up node-readable-stream (3.6.0-2) ... Setting up node-ssri (8.0.1-2) ... Setting up libice6:amd64 (2:1.0.10-1build1) ... Setting up libhttp-date-perl (6.05-1) ... Setting up node-lru-cache (5.1.1-5) ... Setting up node-bcrypt-pbkdf (1.0.2-1) ... Setting up libxft2:amd64 (2.3.3-0ubuntu4) ... Setting up node-promise-retry (2.0.1-1) ... Setting up libfile-basedir-perl (0.08-1) ... Setting up fonts-tlwg-typo (1:0.7.2-1build1) ... Setting up node-supports-color (8.1.0+~7.2.0-1) ... Setting up libfile-listing-perl (6.14-1) ... Setting up fonts-tlwg-waree (1:0.7.2-1build1) ... Setting up node-once (1.4.0-3) ... Setting up node-psl (1.8.0+ds-4) ... Setting up node-jsprim (2.0.0-1) ... Setting up libxtst6:amd64 (2:1.2.3-1build2) ... Setting up libxcursor1:amd64 (1:1.2.0-2build2) ... Setting up node-resolve (1.19.0+~cs5.20.8-2) ... Setting up node-ajv (6.12.6-2) ... Setting up libgl1-mesa-dri:amd64 (21.2.2-1ubuntu1) ... Setting up node-are-we-there-yet (1.1.5-1) ... Setting up fonts-tlwg-sawasdee (1:0.7.2-1build1) ... Setting up libnet-http-perl (6.20-1) ... Setting up node-debug (4.3.1+~cs4.1.5-1) ... Setting up fonts-tlwg-typist (1:0.7.2-1build1) ... Setting up fonts-tlwg-umpush (1:0.7.2-1build1) ... Setting up xfonts-utils (1:7.7+6build1) ... Setting up fonts-tlwg-mono (1:0.7.2-1build1) ... Setting up node-promzard (0.3.0-1.1) ... Setting up node-wcwidth.js (1.0.0-1.1) ... Setting up fonts-tlwg-purisa (1:0.7.2-1build1) ... Setting up node-unique-filename (1.1.1+ds-1) ... Setting up node-ansi-styles (4.2.1-1) ... Setting up node-form-data (3.0.0-2) ... Setting up node-lockfile (1.0.4-3) ... Setting up node-chalk (4.1.0-1) ... Setting up node-spdx-expression-parse (3.0.1-1) ... Setting up xfonts-thai-etl (1:1.2.7-5) ... Setting up fonts-tlwg-norasi (1:0.7.2-1build1) ... Setting up libfile-desktopentry-perl (0.22-2) ... Setting up node-is-typedarray (1.0.0-3) ... Setting up libwww-robotrules-perl (6.02-1) ... Setting up node-tar (6.1.7+~cs11.3.10-1) ... Setting up xfonts-thai-manop (1:1.2.7-5) ... Setting up node-inflight (1.0.6-1.1) ... Setting up libhtml-parser-perl:amd64 (3.76-1) ... Setting up node-hosted-git-info (3.0.8-1) ... Setting up node-tough-cookie (4.0.0-2) ... Setting up xfonts-thai-vor (1:1.2.7-5) ... Setting up xfonts-thai-nectec (1:1.2.7-5) ... Setting up node-opener (1.5.2-1) ... Setting up libsm6:amd64 (2:1.2.3-1build1) ... Setting up libio-socket-ssl-perl (2.069-1) ... Setting up node-string-width (4.2.0-1) ... Setting up libhttp-message-perl (6.29-1) ... Setting up node-sshpk (1.16.1+dfsg-2) ... Setting up libhtml-form-perl (6.07-1) ... Setting up node-semver (7.3.4-1) ... Setting up node-har-validator (5.1.5-1) ... Setting up libfile-mimeinfo-perl (0.30-1) ... Setting up libhttp-negotiate-perl (6.01-1) ... Setting up libglx-mesa0:amd64 (21.2.2-1ubuntu1) ... Setting up xfonts-thai-poonlap (1:1.2.7-5) ... Setting up libglx0:amd64 (1.3.3-1) ... Setting up node-columnify (1.5.4-3) ... Setting up libhttp-cookies-perl (6.10-1) ... Setting up libhtml-tree-perl (5.07-2) ... Setting up libhtml-format-perl (2.12-1.1) ... Setting up node-agent-base (6.0.2-2) ... Setting up fonts-thai-tlwg (1:0.7.2-1build1) ... Setting up node-http-signature (1.3.5-1) ... Setting up node-spdx-correct (3.1.1-1) ... Setting up libgl1:amd64 (1.3.3-1) ... Setting up libnet-smtp-ssl-perl (1.04-1) ... Setting up node-glob (7.1.6+~7.1.3-1) ... Setting up libmailtools-perl (2.21-1) ... Setting up libxt6:amd64 (1:1.2.0-1) ... Setting up node-typedarray-to-buffer (4.0.0-1) ... Setting up libhttp-daemon-perl (6.12-1) ... Setting up node-wide-align (1.1.3-1) ... Setting up node-npm-package-arg (8.1.0-1) ... Setting up xfonts-thai (1:1.2.7-5) ... Setting up node-request (2.88.1-5) ... Setting up node-https-proxy-agent (5.0.0-3) ... Setting up node-rimraf (3.0.2-1) ... Setting up node-validate-npm-package-license (3.0.4-1) ... Setting up libxmu6:amd64 (2:1.1.3-0ubuntu1) ... Setting up node-write-file-atomic (3.0.3+~3.0.1-1) ... Setting up node-copy-concurrently (1.0.5-7) ... Setting up node-move-concurrently (1.0.1-2) ... Setting up libxaw7:amd64 (2:1.0.13-1.1) ... Setting up x11-xserver-utils (7.7+8build1) ... Setting up node-gauge (2.7.4-1.1) ... Setting up node-normalize-package-data (3.0.0+~2.4.0-1) ... Setting up x11-utils (7.7+5build1) ... Setting up node-npmlog (4.1.2-2) ... Setting up node-cacache (15.0.5+~cs13.9.21-1) ... Setting up node-read-package-json (3.0.0-1) ... Setting up node-gyp (7.1.2-4) ... Setting up npm (7.5.2+ds-2) ... Setting up libwww-perl (6.53-1) ... Setting up liblwp-protocol-https-perl (6.10-1) ... Setting up libxml-parser-perl:amd64 (2.46-2) ... Setting up libxml-twig-perl (1:3.52-1) ... Setting up libnet-dbus-perl (1.2.0-1build1) ... Processing triggers for man-db (2.9.4-2) ... Processing triggers for mailcap (3.69ubuntu1) ... Processing triggers for libc-bin (2.34-0ubuntu3) ... Scanning processes... Scanning linux images... Running kernel seems to be up-to-date. No services need to be restarted. No containers need to be restarted. No user sessions are running outdated binaries.
Check version:
node -v
npm -v
root@tutorialspots:~# node -v v12.22.5 root@tutorialspots:~# npm -v 7.5.2