I'm not sure why many posts and blog make problem more comlicated ,Let's use :

cd /tmp
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc

Now, after restart terminal, you can able to use it,

nvm

Image description

Reference