update node in ubuntu
> sudo apt purge nodejs npm
then install curl
> sudo apt install curl
install nvm: check for latest version on nvm page
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
reload bash
“sh
source ~/.bashrc
install nvm
```sh> nvm install node
it will download latest node js version
set latest as default
> nvm alias default node