I was getting this error on a Debian Linux system. I noticed that the same thing worked fine on Windows.
I further noted that the Node.JS executable is called node on Windows, but on Debian (and on Debian based systems like Ubuntu) it is called nodejs. So I created an alias - from the root terminal, I ran
ln -s / usr / bin / nodejs / usr / local / bin / node
and this solved the problem.
source share