Duplicate node installation

0

Check in Ubuntu 18, I want to update to the latest version of node and npm, and then update angular cli. The issue is that I find 2 versions of pre-installed node. If I do a node -v, it pulls 6.11.14 and if I do sudo node -v (with sudo), it throws me 8.10.0

I do not quite understand what version is finally what the operating system uses for the angular functions. And what I understand the least is how to update version 6.11.14 that I have here, since I understand that the commands to update go with sudo, and if I do that, I update version 8.10.0, not 6.11.14.

    
asked by rendor9 25.05.2018 в 02:45
source

1 answer

0

You have installed a version with sudo and the other version is installed locally with your normal user.

Run: ll / usr / bin / node if this file exists, just run rm / usr / local / bin / node of the normal user.

If you run the normal user's node, you'll probably see that it points to the bin directory > user's location.

You can try:

/ usr / local / bin / node

This means that the normal user has installed another node version locally.

To allow the same node version to apply to all users, this command must show usr bin (not local).

As follows:

/ usr / bin / node

Deleting the% link% co_ will automatically start using

  

/ usr / local / bin / node

    
answered by 03.06.2018 в 19:08