microsoft/TypeScript-Handbook

module resolution is confused

chnliquan opened this issue · 5 comments

In this handhook, the module resolution is that:

image

but in the real project, there is no node_modules/@types/moduleB.d.ts, it only has a node_modules/@types/moduleB directory,
image
it is confused that resolution strategy by handhook, please show the hole strategy of module resolution

I think that when resolution @types/moduleB it will treat it as a folder (similar to node resolution), but I don't know which step it performed this process. I didn't explicitly according to the example.

can anybody help me to solve it ?

Vinnl commented

I have no idea what this is about and am not familiar with the handbook @chnliquan, so I'm not sure why you tagged me...

The content from handbook is not that "correct". It will check /root/src/node_modules/@types/moduleB.d.ts. AND it will also check /root/src/node_modules/@types/moduleB/ directory if it contains a package.json file.