DEV Community

Cover image for How to fix Duplicate identifier IteratorResult
Pierre-Henry Soria ✨
Pierre-Henry Soria ✨

Posted on

 

How to fix Duplicate identifier IteratorResult

Summary

If you are getting these kinds of errors

node_modules/@types/node/index.d.ts:166:11 - error TS2300: Duplicate identifier 'IteratorResult'.
Enter fullscreen mode Exit fullscreen mode

node_modules/@types/node/index.d.ts:166:11 - error TS2300: Duplicate identifier 'IteratorResult'

Why do I receive it now?

For instance, this could happen after bumping tslint package or any similar packages where the library upgrade would cause this issue.

How can I fix it?

If you get these ones, it's very likely you are missing some TS type definitions. Usually, you would just have to install the corresponding NodeJ TypeScript types with either npm install --save-dev @types/node or yarn package manager yarn add -D @types/node

Once this is done, re-run your Node project and it should be all gone 🤠

Top comments (0)

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

⭐️🎀 JavaScript Visualized: Promises & Async/Await

async await