There are many possibilities for this, the most probable from my point of view is that, you installed the Node.js
, that is to say, it already has it installed, but it is not GLOBAL (in the environment variables PATH
or as "shortcut" of commands).
But it is likely that you have put the command npm
as a whole, similar to the situation of composer
in Linux:
In accordance with these answers in Soen and being Ubuntu, you can try the command:
dpkg-query -L nodejs
I don’t have linux to test at the moment
It is likely that the path is /usr/bin/node
or /usr/bin/nodejs
, But until then, it’s just a hypothesis. It could be anything up until then, you installed, uninstalled things, it could simply be a bug version, you could have installed multiple versions of nodejs and then removed one of them keeping the other, yet yes while removing the variable PATH
had already been overwritten.
I’m not gonna get much of a chance because it seems like a local mistake. Yet something I need to point out that I don’t understand why you’re using nodejs-legacy
on Ubuntu, unless you really want some support for older applications.
Now if your Ubuntu is old there should be missing things, I recommend you follow the steps in:
https://github.com/nodesource/distributions/blob/master/OLDER_DISTROS.md
If you spin
npm show node version
also occurs error?– Pagotti
@Pagotti Look what interesting guy, rotated normal, version 10.9.0. I did not know this command no. Thanks man.
– LeAndrade
This command shows the version of the Node package that npm sees in the repository, but it doesn’t mean that this version is installed in your environment. You may have to run Node installation again.
– Pagotti
Right entnedi man. If I install Node again I run the risk of losing something?
– LeAndrade
I won’t say it has no risks. Always has pq has global settings, but it all depends on your environment.
– Pagotti
All right, Thanks again!
– LeAndrade