Installing angular 12.0.1 for Node.js 14.21.3 in Ubuntu 22.04

I am trying to install Angular 12.0.1 in Node.js v14.21.3 in Ubuntu 22.04.

I get this error after installation when I want to check the version:

(base) mona@ada:~$ sudo npm install -g @angular/[email protected]
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng

> @angular/[email protected] postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js

? Would you like to share anonymous usage data with the Angular Team at Google under
Google’s Privacy Policy at https://policies.google.com/privacy? For more details and
how to change this setting, see https://angular.io/analytics. Yes
+ @angular/[email protected]
added 235 packages from 182 contributors in 15.206s
(base) mona@ada:~$ ng v
Node.js version v14.21.3 detected.
The Angular CLI requires a minimum Node.js version of v18.13.

Please update your Node.js version or visit https://nodejs.org/ for additional instructions.

I installed node v14.X using the following:

curl -sL https://deb.nodesource.com/setup_14.x -o setup_14.sh

sudo sh ./setup_14.sh

sudo apt update

sudo apt-get install -y nodejs

mona@ada:~$ node -v
v14.21.3

Updates:

I followed https://angular.io/guide/versions and installed node v14.15.0 and then proceeded to install Angular 12.0.1. However, I still get the same message:

(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ node -v
v14.21.3
(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ sudo apt-get remove nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  nodejs
0 upgraded, 0 newly installed, 1 to remove and 441 not upgraded.
After this operation, 121 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 479633 files and directories currently installed.)
Removing nodejs (14.21.3-deb-1nodesource1) ...
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules' not empty so not removed
Processing triggers for man-db (2.10.2-1) ...
(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ node -v
bash: /usr/bin/node: No such file or directory
(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ nvm install 14.15.0
Downloading and installing node v14.15.0...
Downloading https://nodejs.org/dist/v14.15.0/node-v14.15.0-linux-x64.tar.xz...
######################################################################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v14.15.0 (npm v6.14.8)
(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ node -v
v14.15.0
(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ npm install -i @angular/[email protected]
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported

> [email protected] postinstall /home/mona/dimo-labeling/frontend/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> @angular/[email protected] postinstall /home/mona/dimo-labeling/frontend/node_modules/@angular/cli
> node ./bin/postinstall/script.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/[email protected]
added 1327 packages from 1176 contributors and audited 1332 packages in 15.114s

86 packages are looking for funding
  run `npm fund` for details

found 262 vulnerabilities (2 low, 163 moderate, 79 high, 18 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
(dimo-labeling) mona@ada:~/dimo-labeling/frontend$ ng v
Node.js version v14.15.0 detected.
The Angular CLI requires a minimum Node.js version of v18.13.

Please update your Node.js version or visit https://nodejs.org/ for additional instructions.

enter image description here