I have a Node.js (v16.15.0) script that uses TypeScript (v4.9.3) and I want to use remark-parse
(v10.0.1) to parse Markdown into AST. However I get this error:
> tsc --outDir dist
node_modules/remark-parse/lib/index.d.ts:3:26 - error TS2307: Cannot find module 'mdast-util-from-markdown/lib' or its corresponding type declarations.
3 options: void | import('mdast-util-from-markdown/lib').Options | undefined
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in node_modules/remark-parse/lib/index.d.ts:3
mdast-util-from-markdown
is definitely installed and that file exists. But TypeScript can't find it. What's going wrong?
My tsconfig:
{
"compilerOptions": {
"types": [
"node"
],
"rootDir": "src",
"outDir": "dist",
"module": "NodeNext"
},
"include": ["src"]
}
I have searched for ages to find the cause of this.