Error: Could not find declaration file for module 'asn1'
See original GitHub issueI am making a program in TS and while building this error pops up. Any idea why?
node_modules/ldapts/dist/filters/Filter.d.ts:2:38 - error TS7016: Could not find a declaration file for module 'asn1'. '.../node_modules/asn1/lib/index.js' implicitly has an 'any' type.
Try `npm install @types/asn1` if it exists or add a new declaration (.d.ts) file containing `declare module 'asn1';`
2 import { BerReader, BerWriter } from 'asn1';
Same error also occurs for other .d.ts
files like Attribute.d.ts
, Change.d.ts
, Control.d.ts
Btw there is no types for asn1
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'module-name ...
In order for this to work, I had to make declare module '...' the first line of code in the module.d.ts file, and...
Read more >tsc: Could not find a declaration file for module 'asn1js'. #11
Try `npm install @types/asn1js` if it exists or add a new declaration (.d.ts) file containing `declare module 'asn1js';` 4 import * as asn1...
Read more >How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >Error: Could not find a declaration file for module - YouTube
Fix error : Could not find a declaration file for module ... implicitly has an 'any' type.Try npm install library-name if it exists...
Read more >Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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 GitHub Comments
@Ashniu123, the PR with DefinitelyTyped was approved and I pushed out v1.2.3 that references the asn1 types from there. Hope that helps!
I have a PR to DefinitelyTyped to add the types. It sounds like it takes a couple days to be approved, but it should be there shortly. You can follow progress at https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32634