Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
698 views
in Technique[技术] by (71.8m points)

node.js - Can't uninstall global npm packages after installing nvm

I've found several threads related to this issue but none seem to deal with my case specifically and I've been unable to solve using the suggestions I've found.

When I run npm uninstall -g "some package"

it just returns: up to date in .043s - And the global package remains.

For example I'm trying to uninstall babel-cli and after running npm uninstall -g babel-cli I'm still able to use the cli.

This started after I uninstalled node and npm and reinstalled using nvm. I'm wondering if I missed something while uninstalling node and it's causing the issue. I checked my dot files and noticed I still have a .npm outside of .nvm. Is that normal? Thanks in advance for any suggestions.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

(nvm maintainer here)

The list of things that you can npm uninstall -g is available at npm ls -g --depth=0. If you don't see the thing you want to uninstall there, but you can still access it, then if it was npm-installed, it was probably installed with your system version of node.

You can quickly verify this with nvm use system && npm ls -g --depth=0. If you see the package there, then while using the system version, you can npm uninstall -g it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...