Here i already answered to a similar question. Install Nodejs v18 on Ubuntu 18.04
Allthough it is related to docker, the result is the same.
Seams that ubuntu 18.04 is not nativly supported by nodejs anymore.
If you are using Ubuntu 18.04 as your Host-Os, consider updating it to 20.04 or 22.04. Im running node18 on Ubuntu 22.04. No issues!
Consider to install a node version manager. This allows you to switch easily between different node versions.
https://github.com/nvm-sh/nvm
Here an article how you can do that:
https://tecadmin.net/how-to-install-nvm-on-ubuntu-20-04/
Last solution, if you are familiar with docker, could be executing your app inside a docker container with node18.
If all this is not an option for you, downgrade to node16, which is still supported till september 2023.