On Ubuntu 16.04, I mistakenly used root to install nvm, and then to install node.js 8.8.1 via nvm. I also used nvm alias default 8.8.1, thinking it would correct my
nvm alias default 8.8.1
rm -Rf ~/.nvm
This is the nuclear option in my case. just -R would ask me if I really wanted to delete every file in the nvm folder.