error TS2688: Cannot find type definition file for...random paths.
See original GitHub issueUsing https://github.com/atrauzzi/gerty on the branch hashi-gerty.
Basically anything that tries to do typescript gets a bunch of errors about not finding type definitions I never reference in any of my source files.
(For the simplest example, I do a yarn install and then ./node_modules/.bin/ts-node.)
PS C:\Users\atrauzzi\Development\atrauzzi\gerty> .\node_modules\.bin\ts-node
> console.log('hi');
error TS2688: Cannot find type definition file for '.github'.
error TS2688: Cannot find type definition file for 'build'.
error TS2688: Cannot find type definition file for 'examples'.
error TS2688: Cannot find type definition file for 'scripts'.
error TS2688: Cannot find type definition file for 'src'.
error TS2688: Cannot find type definition file for 'website'.
undefined
>
Apologies, I have searched for this, but wasn’t able to find anything relevant or within the last few months.
What is happening and why am I getting these weird errors? Is there any way they can be improved if it is in fact something that I’ve done wrong?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:35
- Comments:45 (4 by maintainers)
Top Results From Across the Web
Fixing TS2688: Cannot find type definition file in node_modules
When running tsc, I am getting many TS2688: Cannot find type definition file for 'someLibrary' These libraries came from node_modules .
Read more >Error TS2688: Cannot find type definition file for 'node'
If am receiving this error when running the vtex link command: Webpack for react@3.x builder finished in 464ms with errors: [at-loader] ...
Read more >Cannot Find Type Definition File For '$' - ADocLib
Angular 7: cannot find the type definition file It seems that you are using expressions. error TS2688: Cannot find type definition file forrandom...
Read more >Fundamentals Engineering Handbook Solution File Type ... - vcs
2019 open solution file incompatible thermo fisher scientific jp paperless coupons walgreens error ts2688 cannot find type definition file for random paths ......
Read more >Release Notes for the UI5 Type Definitions - SAP
TS2688 Cannot find type definition file for 'node_modules'. This error can be displayed by the TypeScript compiler and at the first character of...
Read more >
Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top Related StackOverflow Question
These errors occur when you have subdirectories of a
typeRootsdirectory (in this casenode_modules/@types) that do not containindex.d.tsfiles. I agree the error message is mysterious and should be improved.In your case, the errors occur because your
package.jsonspecifies a package named@types/, which is a silly thing to do.I have this error today! But the code still got compiled to js 😶