Cannot find module ‘node_modules\antlr4ts\atn\ATN‘ #525
Description
When I run the TS file compiled by antlr4ts, the following error is prompted:
CustomError: Cannot find module 'C:\MyProjects\GaeaTransFormulaApiTs\node_modules\antlr4ts\atn\ATN' imported from C:\MyProjects\GaeaTransFormulaApiTs\src\antlr\tdx\TdxParser.ts
Error source code:
import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; ...
my tsconfig.json:
{ "compilerOptions": { "target": "esnext", "module": "esnext", "types": ["node"], "moduleResolution": "node", "strict": true, "lib": ["esnext", "dom"], "sourceMap": false, "resolveJsonModule": true, "esModuleInterop": true, "baseUrl": ".", "outDir": "./dist" }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/antlr/tdx/TdxParser.js"] }
my run script:
nodemon -e ts --exec node --loader ts-node/esm src/app.ts
my antlr4ts version:
^0.5.0-alpha.4
my typescript version:
^4.6.2