"Cannot find module 'conf'" unless setting "moduleResolution": "node16" or "nodenext"
jameshfisher opened this issue · 1 comments
jameshfisher commented
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.