Nvm: Should I remove system node?

Created on 28 Jun 2018  Β·  6Comments  Β·  Source: nvm-sh/nvm

Hi,

In the documentation is says "You can (but should not?) keep your previous "system" node install". Could you please elaborate on this a bit and let me know how I can safely remove the system node install?

All 6 comments

You're welcome to keep or remove it.

How to remove it depends on how you installed it.

I downloaded the 8.11.3 LTS from the node website

In that case you’ll need to manually remove the directories if you want to uninstall it; but it’s perfectly fine to keep that around.

No I think it is not perfectly fine to keep that around, because I met a problem, the global modules of system would interfere in node of nvm. Like following.

I had some modules in the global of system node:

GQSM@Applede-MacBook-Pro ~ % nvm current
system
GQSM@Applede-MacBook-Pro ~ % npm ls -g --depth=0                         
/usr/local/lib
β”œβ”€β”€ @vue/[email protected]
β”œβ”€β”€ @vue/[email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
└── [email protected]

Then I change to node of nvm:

GQSM@Applede-MacBook-Pro ~ % nvm use v12.18.3   
Now using node v12.18.3 (npm v6.14.6)
GQSM@Applede-MacBook-Pro ~ % npm ls -g --depth=0
/Users/GQSM/.nvm/versions/node/v12.18.3/lib
└── [email protected]

GQSM@Applede-MacBook-Pro ~ % webpack-cli --version
3.1.0

When I change to node of nvm, I still can access modules of system node. My version of nvm is v0.35.3, I don't know how to solve this problemm. But I think the problem is with node of system?

@ms314006 thats a feature, not a bug. You can either uninstall those system global modules (or your entire system node), you can remove that directory from your PATH, or you can install the same global modules in your nvm-managed node.

The best alternative is to avoid having global modules installed at all :-) install things locally and/or use npx.

@ljharb I am really grateful your reply so fast and clearly! I will try to uninstall entire system node, really thank for your comments!

Was this page helpful?
0 / 5 - 0 ratings