Home > Software engineering >  Could not find a declaration file for module 'mymodule'
Could not find a declaration file for module 'mymodule'

Time:01-21

I tried to import my test module installing with npm i github.com/.../... and the codes, it's working properly, but in VSCode it has something like this:

Could not find a declaration file for module 'estrajs'. 'C:/Users/Users/Desktop/Test/TestFolder/node_modules/mymodule/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/mymodule` if it exists or add a new declaration (.d.ts) file containing `declare module 'mymodule';`ts(7016)

How do I make the declaration of it? I already make file on typings/index.d.ts

CodePudding user response:

Ah I figured out, I simply just type on index.d.ts file

declare module 'mymodule';

CodePudding user response:

try to add the following to the tsconfig.json file

"noImplicitAny": false
  •  Tags:  
  • Related