3

I've just tried about every non-windows solution from this question and it indeed did something, but

npm ls -gp --depth=0.

returns

/usr/local/lib
/usr/local/lib/node_modules/@angular/cli

and that entry seems to be immortal. One of the the commands I tried was

sudo npm ls -gp --depth=0 |
awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' |
xargs sudo npm -g rm

which now reports "up to date". I can see that in the end

sudo npm -g rm cli

gets executed, but does nothing (no idea if it should, I'm just trying to do a clean up to get a college's angular project running on my computer).

I've also tried variations with uninstall in place of rm and many other clueless approaches, but nothing changes.

Should I just nuke /usr/local/lib/node_modules or how else can I get rid of cli?


npm --version
5.6.0
Harshal Yeole
  • 4,812
  • 1
  • 21
  • 43
maaartinus
  • 44,714
  • 32
  • 161
  • 320
  • I guess, I installed `npm` with `sudo`, which [is said to be wrong](https://stackoverflow.com/a/19354387/581205), but an uninstall should work anyway, shouldn't it? – maaartinus Jun 01 '18 at 07:26
  • you can remove every module form `/usr/local/lib/node_modules` manually. – Anshuman Jaiswal Jun 01 '18 at 08:30
  • @AnshumanJaiswal But there's also `/usr/local/bin/ng -> ../lib/node_modules/@angular/cli/bin/ng` and possibly others.... – maaartinus Jun 01 '18 at 09:21

1 Answers1

0

The module name is apparently @angular/cli, not just cli. I also had this installed as a global module, and I was able to remove it (on Ubuntu 18.04) with:

sudo npm -g rm @angular/cli
krubo
  • 5,969
  • 4
  • 37
  • 46