Skip to content

"Cannot find module 'conf'" unless setting "moduleResolution": "node16" or "nodenext" #175

@jameshfisher

Description

@jameshfisher

Minimal example here: https://github.com/jameshfisher/bug-example-conf-import

I followed the instructions in the README, but got this confusing error:

$ npx tsc
main.ts:1:18 - error TS2307: Cannot find module 'conf' or its corresponding type declarations.

1 import Conf from 'conf';
                   ~~~~~~

Through trial and error, I found that the error goes away after setting "moduleResolution": "node16" in tsconfig.json. However, this setting causes other issues in my project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions