Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module '"dns"' has no exported member 'promises' #16

Closed
douglas-mason opened this issue Apr 24, 2020 · 6 comments
Closed

Module '"dns"' has no exported member 'promises' #16

douglas-mason opened this issue Apr 24, 2020 · 6 comments

Comments

@douglas-mason
Copy link

I've added got to my project which has cacheable-lookup as a dependency. I can't compile the TypeScript project as I get the following error.

node_modules/cacheable-lookup/index.d.ts(1,34): error TS2305: Module '"dns"' has no exported member 'promises'.

If I remove promises as dnsPromises from the first line of index.d.ts then I can compile the project.
import {Resolver, LookupAddress, promises as dnsPromises} from 'dns';

thanks!

TypeScript: 3.8.3
Node: 14.0.0
cacheable-lookup: 4.1.2

@szmarczak
Copy link
Owner

I haven't tested Node.js 14.0.0 yet

@douglas-mason
Copy link
Author

douglas-mason commented Apr 24, 2020 via email

@szmarczak
Copy link
Owner

It surely works on Node.js 10, 12 and 13: https://github.com/szmarczak/cacheable-lookup/runs/612593859

@douglas-mason
Copy link
Author

I'm sorry, it looks like my project's type definitions for node were out of sync. Thank you for your time. Issue can be closed.

@drazisil
Copy link

drazisil commented Jul 11, 2020

@douglas-mason Can you share how you updated @types/node to fix this?

 ERROR  Failed to compile with 1 errors                                                                                                                                        10:29:15 PM

This dependency was not found:

* dns in ./node_modules/cacheable-lookup/source/index.js

To install it, you can run: npm install --save dns

I've added "@types/node": "14.0.22" and I don't want to install the dns package from npm since it has security issues. Am I to understand that dns should be built-in somehow? It's not listed as a dependency of this project, even though it's being required.

This is my tree

└─┬ got@11.5.0
  └── cacheable-lookup@5.0.3 

@szmarczak
Copy link
Owner

Am I to understand that dns should be built-in somehow? It's not listed as a dependency of this project, even though it's being required.

rm -rf node_modules && npm install usually does the trick. The dns module is a native one, which means you don't have to install that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants