Does Npm run without Node installed?

Asked

Viewed 482 times

0

Use here in the company a Linux Ubuntu, and installed the Vue-cli for npm version 3.5.2, installing the folder Node-modules usually with all the dependencies inside, but when I ran 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, you wouldn’t need it to run?

  • 1

    If you spin npm show node version also occurs error?

  • @Pagotti Look what interesting guy, rotated normal, version 10.9.0. I did not know this command no. Thanks man.

  • 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.

  • Right entnedi man. If I install Node again I run the risk of losing something?

  • I won’t say it has no risks. Always has pq has global settings, but it all depends on your environment.

  • All right, Thanks again!

Show 1 more comment

1 answer

1


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

  • Opa Guilherme thanks for the clarifications.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.