I am currently in the process of transitioning a codebase from Flow to TypeScript. I am encountering an issue with the error message
Cannot find module 'SOME DEPENDENCY' or its corresponding type declarations.ts(2307)
for several dependencies that have their typings included within the dependency itself.
An example of one such dependency is:
./node_modules/axios/index.d.ts
Within my project structure, I have the following files:
./tsconfig.json
./src/SomeFileUsingAxios.tsx
./node_modules
./vendor/node_modules
./vendor/node_modules/axios
I have attempted solutions such as using
"typeRoots": ["./node_modules/@types", "./vendor/node_modules/@types"]
,
as well as "rootDirs": ["./", "vendor/"]
, and even trying both options together ^
Unfortunately, I am unable to get TypeScript to recognize this particular dependency! Any suggestions?