Open meness opened 4 years ago
make sure your node version is not 12.x . i used a higher version with nvm and it is resolved. (16.14.0)
npm install
resolve the issue for me
My problem was solved with next workaround: npm install -D eslint@7.32.0
https://github.com/eslint/eslint/issues/15149#issuecomment-939501275
Ran in to this issue with a repo on two different dev machines. Issue was node version. The repo was built for node 16, the machine running node 12 threw this error. Hope this helps someone in the future 👍
accidentally using node 12 was also my issue
yes, I was getting the issue because I was using node 12.14.x, using v18 resolved it for me.
In my case it was an issue with using yarn
and npm
. No I am not using them together, I always use yarn
but this particular project was using npm
and by muscle memory I added a package with yarn add <package>
but stopped it mid way.
Then I installed it using npm i <package>
and issue started happening. Can't guarantee 100% this was the cause, but the timing of stuff made me think that. 🤷♂️
My solution was deleting node_modules and install again using npm
.
@tonykaram1993 this was the only solution in the thread that worked for me! Thanks!
node 12 was also my issue, thanks @tonykaram1993
I'm using eslint_d
. In my case, I added node_modules
to .eslintignore
and then restarted eslint_d
(first killed and then ran it again) and it solved the problem.
I run
npm install @typescript-eslint/eslint-plugin@latest --save-dev
. Maybe is not the right thing to do but it worked
And need to change path of ESLint package. Settings -> Language & Frameworks -> JavaScript -> Code Quality Tools ->EsLint.
Check field 'Manual ESLint configuration' -> ESLint package. It was ".../current project/node_modules/eslint" and I change path to "C:\Program Files\nodejs\node_modules\eslint" and it's work for me)
p.s. Configuration File -> Automatic search
for me upgrading my node version from 12.12.0 to 16.0.0 resolved the issue. Looks like a problem with old node version.
Changing Node 12 version to the project node version 16 solve the problem for me
For me it was something else entirely.
My project's path contained SPACES!!!
Apparently eslint
/ vscode
doesn't know how to deal with spaces in your project's path.
That error regarding "Cannot find module 'XXXXX'" is BS, because it doesn't even reach your project's directory, so of course it wouldn't find it! At first I installed and installed over and over again, thinking that it actually isn't installed properly or what not, but this error kept occurring.
Move you entire project to a path without spaces, install packages again, and witness the GLORIOUS message of:
"Eslint server is running." at last.
Info About My Stuff:
i upgraded node.js version to 16 and now it's ok
Describe the bug
When I run
eslint: lint whole folder
task, it fails because of the error mentioned in the title.Did you try recovering your dependencies?
Yes, I did.
Which terms did you search for in User Guide?
The issue is not related to any of them, it's ESLint.
Environment
Steps to reproduce
Just run
eslint: lint whole folder
task.This is my ESLint config:
Expected behavior
It should not throw exceptions.
Actual behavior
It throws the above exception.
Reproducible demo