complite nodejs remove ubuntu
Open Terminal on your Ubuntu system using Ctrl + Alt + T or by searching for it in the Applications menu.
Remove the Node.js package using the APT package manager by entering the following command:
bash sudo apt-get purge nodejs
Additionally, remove the npm package manager with the command:
bash sudo apt-get purge npm
After removing the packages, clear the APT cache to free up disk space:
bash sudo apt-get clean
Confirm that Node.js and npm have been uninstalled by checking their versions. If there's no output, it means they are successfully removed:
bash node -v npm -v
You might also want to delete any remaining configuration files related to Node.js or npm:
bash sudo rm -rf ~/.npm sudo rm -rf ~/.node-gyp
Lastly, to ensure a clean removal, reboot your system:
bash sudo reboot