C:\Users\gagul\WebstormProjects\vsbl>yarn lint
yarn run v1.19.1
$ eslint .
Error: Failed to load parser '@typescript-eslint/parser' declared in 'package.json 禄 eslint-config-react-app#overrides[0]': Cannot find module '@typescript-eslint/parser'
Require stack:
- C:\Users\gagul\WebstormProjects\vsbl\node_modules\eslint-config-react-app\index.js
at Function.Module._resolveFilename (module.js:548:15)
at Function.resolve (C:\Users\gagul\WebstormProjects\vsbl\node_modules\v8-compile-cache\v8-compile-cache.js:166:23)
at Object.resolve (C:\Users\gagul\WebstormProjects\vsbl\node_modules\eslint\lib\shared\relative-module-resolver.js:44:50)
at ConfigArrayFactory._loadParser (C:\Users\gagul\WebstormProjects\vsbl\node_modules\eslint\lib\cli-engine\config-array-factory.js:870:45)
at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Users\gagul\WebstormProjects\vsbl\node_modules\eslint\lib\cli-engine\config-array-factory.js:665:32)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (C:\Users\gagul\WebstormProjects\vsbl\node_modules\eslint\lib\cli-engine\config-array-factory.js:596:20)
at _normalizeObjectConfigData.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Users\gagul\WebstormProjects\vsbl\node_modules\eslint\lib\cli-engine\config-array-factory.js:699:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I dont' using TS, why I should install such packages?
Do you happen to have a package in your node_modules folder called microevent.ts (or really anything else ending in .ts/.tsx)? I've started to run into this recently after that package got added as a dependency, despite eslint supposedly ignoring the top level node_modules directory by default.
Removing that package or running lint with a more specific --ignore-pattern "/node_modules/" seemed to solve the isssue for me, though it's still strange that we're getting this error at all despite not being a typescript project.
yes, I have got it
C:\Users\gagul\WebstormProjects\vsbl>npm ls microevent.ts
[email protected] C:\Users\gagul\WebstormProjects\vsbl
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
C:\Users\gagul\WebstormProjects\vsbl>node -v
v8.16.2
C:\Users\gagul\WebstormProjects\vsbl>npm -v
6.13.4
Added such packages temporarily, but specific param also hack =(, wait, by default eslint not ingoring node_modules?!, that's why it's so slowly? Don't you think to add this param to CRA?
I had the '@typescript-eslint/parser' declared in 'package.json problem too despite I don't use TS on the project and the setup was fine on earlier versions of create-react-app. The solution for me was adding node_modules to .eslintignore.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.
Most helpful comment
I had the
'@typescript-eslint/parser' declared in 'package.jsonproblem too despite I don't use TS on the project and the setup was fine on earlier versions of create-react-app. The solution for me was addingnode_modulesto.eslintignore.