I had an old version of eslint
:
eslint -v
v4.5.0
To update eslint
I ran:
npm install -g eslint
The response said that eslint@5.9.0
had been installed successfully. Following the instructions in the documentation in my project root I ran
eslint --init
I selected the Google style guide. The install said
The style guide "google" requires eslint@>=5.4.0. You are currently using eslint@4.5.0.
Do you want to upgrade? (Y/n)
That seemed odd, as I'd just installed 5.9.0, but I said Yes. The response said that the installation was successful:
Successfully created .eslintrc.json file in /Users/TDK/LanguageTwo
ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy.
Then I ran
eslint -v
v4.5.0
I checked echo $PATH
and didn't see anything like eslintvm
locking in an old version.
I tried to lint a file and got this error message:
Error: Cannot find module 'eslint-config-google'
eslint v5.9.0 is now installed locally in my project root and I can see eslint-config-google
in the node modules. eslint 5.9.0 is installed globally. My guess is that the "missing" eslint-config-google
is because my computer is still running eslint v4.5.0. I restarted my computer. What is keeping eslint at v4.5.0?