Reputation: 11
I have installed NodeJs in root user.When I tried to install it in sudo user, but i was not able to Install Nodejs. I was able to remove the npm packages. I am not able to remove NVM packages. So please help me to uninstall NVM packages from root user.
Upvotes: 1
Views: 7999
Reputation: 1155
Note for the next installation: if it seems that cannot run nvm, try to close the terminal, and reopen it again.
To uninstall nvm from root try:
$ rm -rf /root/.nvm
Then edit /root/.bashrc
file, find the following lines and delete them:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion
If there is no /root/.nvm
directory, then you need to figure out where did you install nvm. Find an .nvm
directory, and delete it.
Upvotes: 1