Describe the bug
When attempting to run the project in CommonJS mode, an error occurs, stating that it cannot find the module typescript. This issue prevents the application from functioning as expected.
To Reproduce
- Create a new Node.js project and configure it to use CommonJS module system
- Install the "berryjam" package as a dependency for your project
- Copy the code from the README.md of the "berryjam" package. The code contains TypeScript-specific type and interface declarations, I removed them since I mentioned using CommonJS mode
- Execute the file to start the scanning process
Expected behavior
The application should be able to run in CommonJS mode without encountering this typescript module error.
Node Version
18.16.1
OS
No response
Browser
No response
Additional Context
Error Message:
Error: Cannot find module `typescript`
Require stack:
- ../node_modules/berryjam/lib/cjs/utils/compiler.js
- ../node_modules/berryjam/lib/cjs/vue-scanner.js
- ../node_modules/berryjam/lib/cjs/index.js
- ../main.cjs
at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (/Users/tong/Documents/node_modules/berryjam/lib/cjs/utils/compiler.js:35:25)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19) {
code: 'MODULE_NOT_FOUND',
Describe the bug
When attempting to run the project in CommonJS mode, an error occurs, stating that it cannot find the module
typescript. This issue prevents the application from functioning as expected.To Reproduce
Expected behavior
The application should be able to run in CommonJS mode without encountering this
typescriptmodule error.Node Version
18.16.1
OS
No response
Browser
No response
Additional Context
Error Message: