Failed to remove global package.

Trying to remove a global package and does not seem to remove it.

$ eslint -v
v1.10.3
$ npm uninstall eslint -g
$ sudo npm uninstall eslint -g
$ eslint -v
v1.10.3
$ sudo eslint -v
v1.10.3
$ which eslint
/usr/local/bin/eslint

You can see that eslint is still in version 1.10.3. Why does this not delete?

+2
source share
1 answer

It is likely that npm is trying to remove it from one place, but you still installed it somewhere else.

This is a problem when, for example, a program npmuses #!/usr/bin/env nodea shebang in the string instead of the exact patch for the binary file nodefor which it was installed (common for Node binary installations), especially when you have many versions of Node installed in many places.

See what is the result:

which node
which npm
cat `which npm` | head -1
cat `which eslint` | head -1
ls -alp `which npm`
ls -alp `which eslint`
cat $PATH

and try to narrow down the problem.

+2

Source: https://habr.com/ru/post/1674758/


All Articles