@types/eslint Error: ChainExpression and ImportExpression members of ESTree not exported

Viewed 6478

I am having some troubles after executing my angular application with npm start, 'ChainExpression' & 'ImportExpression'members of ESTree interface are not exported causing errors...

Please check image below:

enter image description here

I am using Angular 12 and next node dependencies in my package.json, please see below:

{
...
"@types/node": "12.11.1",
"eslint": "7.10.0",
"ts-node": "8.3.0",
"tslib": "2.2.0",
"tslint": "6.1.0",
"typescript": "4.2.4",
...
}

Do you have any idea about this problem? I will appreciate any kind of help.

5 Answers

I had the same problem and could see there was a problem with my node modules @types: eslint was referring to ChainExpression and ImportExpression which were missing from estree. compared these with a new angular12 project and then fixed by updating my estree like so:

npm install @types/estree@0.0.47 

I had the same problem. led me to adding "typeRoots": ["node_modules/@types"] to tsconfig.json which solved it.

$ node -v
v16.13.0

$ npm -v
8.5.1

$ yarn -v
1.22.5

Try updating eslint to version 7.27.0, delete package-lock.json, delete node_modules folder and then npm install again.

It seems @types/estree updated 14 hours ago looking here and this could be causing issues.

By the way, if you are using eslint for linting, you can get rid of tslint entry in package.json.

Somehow @types/eslint is behind. Solution to this problem is:

npm install --save-dev @types/eslint

Then remove package-lock.json and node_modules folder and run install again:

npm install

Errors should be gone now.

I had the same problem running typedoc.

This fixed it.

npm install @types/estree@latest
Related