I have followed This digital ocean tutorial for installing node . and when i tried to run command sudo apt-get install npm it gave me error that
The following packages have unmet dependencies: npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
I removed it completely using This Post and install nodeJs again using This NVM tutorial It ended successfully installing .I made app.js with "hello world" as response and run the command node app.js and when i hit the localhost:3000 it showed Hello world - But once i closed my terminal and run node app.js it failed saying The program 'node' is currently not installed. You can install it by typing: sudo apt install nodejs-legacy while i have done that before . It only runs again if i follow all the steps of nvm installation again