Anyone having this issue, and have tried all of the above and doesn't work, I did the following:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install 20
node -v
npm -v