error TS2688: Cannot find type definition file for...random paths.

See original GitHub issue

Using 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:open
  • Created 5 years ago
  • Reactions:35
  • Comments:45 (4 by maintainers)

github_iconTop GitHub Comments

197reactions
mattmccutchencommented, Oct 18, 2018

These errors occur when you have subdirectories of a typeRoots directory (in this case node_modules/@types) that do not contain index.d.ts files. I agree the error message is mysterious and should be improved.

In your case, the errors occur because your package.json specifies a package named @types/, which is a silly thing to do.

99reactions
blurkcommented, Oct 24, 2020

I have this error today! But the code still got compiled to js 😶 error image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found