Then I ran the following command to see what I have in my /usr/bin/ directory for node and found that it was linked to /usr/bin/nodejs (which I uninstalled earlier). home/nimeshka/.nvm/versions/node/v8.9.3/bin/nodeĪlthough it showed the correct path for node, npm failed because its referring to node inside my /usr/bin path. So to confirm if I'm using the right node binary, I ran the command which node and it showed the right node binary path inside the nvm directory inside my home directory.
usr/bin/env: node: No such file or directory Now whenever I ran the npm install command, it failed stating: This caused problems when using the NPM because it was referring to old nodejs version. So I installed the latest LTS version of node using the Node Version Manager (NVM) and noticed that I had two versions of node running after this upgrade.
Then I checked the node version and it was really old, and noticed I installed it using the Ubuntu repos (which doesn't get latest updates.) When I was trying to install a module using npm today, it returned an error stating that my nodejs version is old and it needs to be updated.