I am currently working on a nodejs web application I am having trouble pushing the application online with cloud foundry. I did some research on the errors and it seems that
I got the same problem when installed the gazebo gzweb. I found out that apt install nodejs
install the "node" in the direction of "/usr/bin/". You can verify by which node
. But node -v
is still referring to "/usr/local/bin/node" which is a wrong version I failed to uninstall.
Thus as my solution:
rm -rf /usr/local/bin/node
cp -i /usr/bin/node /usr/local/bin/
cp -i /usr/bin/nodejs /usr/local/bin/
Steps:
sudo apt-get install npm
npm install -g n
n stable
npm install npm@6.9.0 -g
ln -s /usr/local/bin/npm /usr/bin/npm