Does Npm run without the Node installed?

0

I use a Linux Ubuntu here, and I installed vue-cli with npm version 3.5.2, installing the node-modules folder > usually with all dependencies inside, but when I run a node -v it prints the following message on the terminal The 'node' program is not currently installed. You can install it by typing: sudo apt install nodejs-legacy . But npm is not a Node package manager, would not it need to be able to run it?

    
asked by anonymous 31.08.2018 / 22:22

1 answer

1

There are many possibilities for this, the most likely from my point of view is that, you have installed Node.js , that is, you already have it installed, but it is not GLOBAL (in environment variables PATH or as "shortcut" of the commands).

But it is likely that you have put the command npm as global, similar to the situation of composer in Linux:

As these answers in SOen and being Ubuntu, you can try the command:

dpkg-query -L nodejs
  

I do not have linux to test at the moment

The path is likely to be /usr/bin/node or /usr/bin/nodejs , but until then it's just a hypothesis. It could be anything by then, you installed, uninstalled things, it could be simply a bugged version, you could have installed multiple versions of the nodejs and then removed one of them while keeping the other, even while removing the variable PATH had already been overwritten.

I'm not going to be too hypothetical because it seems like a local error. Still something I need to point out that I do not understand why you are using nodejs-legacy in Ubuntu, unless you really want some support for older applications.

Now if your Ubuntu is old then yes it should be missing things, I recommend that you follow the steps in:

link

    
31.08.2018 / 22:43