Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't global uninstall npm package (eslint) OS X

Tags:

npm

eslint

I have eslint installed and I wanted to update it to a newer version. Upon trying to do this, I found out that I can't get rid of my current version of eslint.

I tried uninstalling via npm but it doesn't seem to remove the command.

$ eslint -v
v3.0.1
$ npm uninstall -g eslint
<a huge list of eslint node_modules>
$ eslint -v
v3.0.1

I tried checking where the command was from and where my global packages were saved but I am not sure what to do with this information.

$ which eslint
/usr/local/bin/eslint

That file was an alias to /usr/local/lib/node_modules/eslint/bin/eslint.js

$ npm list -g
/Users/inspiredtolive/.nvm/versions/node/v7.10.0/lib
<list of packages>

All I really want to do is install eslint with the version greater or equal to 4.9.0. What should I do?

like image 911
inspiredtolive Avatar asked Nov 01 '17 20:11

inspiredtolive


Video Answer


2 Answers

You probably installed global npm package in an older node version. If this is the case reinstall all global packages to latest version directory by running

nvm reinstall-packages

then

npm remove eslint
like image 65
FDisk Avatar answered Oct 01 '22 15:10

FDisk


Maybe you have installed eslint globally via yarn. Try yarn global remove eslint.

BTW global yarn modules are saved here: disk:\Users\Username\AppData\Local\Yarn\Data\global\node_modules

like image 37
N.K. Avatar answered Oct 01 '22 16:10

N.K.