sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nodejs is already the newest version (12.22.12~dfsg-1~deb11u3).
Since node 12.X isn't the latest version, how do I update it?
When I try to run my Ionic application, I get an error message
└──╼ $ionic serve
> ng run app:serve --host=localhost --port=8100
[ng] Node.js version v12.22.12 detected.
[ng] The Angular CLI requires a minimum Node.js version of either v14.20, v16.13 or v18.10.
[ng] Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
[ERROR] ng has unexpectedly closed (exit code 3).
The Ionic CLI will exit. Please check any output above for error details.
On reboot, if the greater version was successfully installed, it reverts to the default version