How to uninstall npm package?

后端 未结 6 688
深忆病人
深忆病人 2020-12-12 12:47

I\'ve installed grunt using sudo npm install grunt and now I can\'t remove it.

I\'ve tried:

$ sudo npm uninstall grunt
         


        
6条回答
  •  天命终不由人
    2020-12-12 13:45

    Running the accepted solution's commands didn't work for me. Running which grunt would result in /usr/local/bin/grunt, but normal (or sudo) npm uninstall -g grunt-cli had no effect.

    This is the command that finally worked for me:

    sudo npm uninstall grunt-cli -g --prefix=/usr/local
    

    Thanks to gengxuelei on github for the solution!

提交回复
热议问题