0👍
I have the same problem and solved it.(my OS is ubuntu 19.4)
the reason that this problem happens, is you installed nodejs and npm separately.
so At first, you should remove nodejs and npm.
sudo apt --auto-remove purge npm
sudo apt --auto-remove purge nodejs
and then install just nodejs
sudo apt-get install nodejs
At last, do following commands for checking nodejs and npm
node -v
npm -v
Source:stackexchange.com