I've installed grunt
using sudo npm install grunt
and now I can't remove it.
I've tried:
$ sudo npm uninstall grunt
But it gives me a WARN
:
npm WARN uninstall not installed in /home/kuba/projects/node_modules: "grunt-cli"
I've also tried rm
, remove
and unlink
. and -g
options, but those give:
npm WARN uninstall not installed in /usr/lib/node_modules: "grunt"
But I still can run grunt
from command line.
EDIT:
$ whereis grunt
grunt: /usr/local/bin/grunt
$ file /usr/local/bin/grunt
/usr/local/bin/grunt: symbolic link to `../lib/node_modules/grunt/bin/grunt'
$ ls /usr/local/lib/node_modules
grunt jshint
$ ls /usr/lib/node_modules
bower csslint devtools-terminal npm plato
Why I have 2 directories with npm
? Is it safe to just delete them?
EDITOR NOTE:
This question was asked over 5 years ago as How to uninstall npm package. It's been a very useful question favourited by many, who found a solution to their problem, so I'm changing it back from a recent edit that called it How to uninstall grunt package, because it requires the same procedure as any other npm
package.