First, use this code to remove them:
sudo apt-get remove nodejs
sudo apt-get remove npm
Then go to /etc/apt/sources.list.d and check if there is any node list, if there is any remove them. Then do a:
sudo apt-get update
Note: also, check for node & npm folders, if there are any just remove them. The best practice to install node would be using NVM manager.