Some fast commands are below. The complete documentation (including other platforms) is here
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt install nodejs
brew update
brew install node@18
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo yum install nodejs