I use Node.JS workspace with the following structure:
root/
|- build/
|- ModuleA/
|- build/
|- ModuleB/
|- build/
|- WebAPI/
|- build/
|- server.ts
Running the app with ts-node-esm src/webapi/server.ts
bumps into the following error:
CustomError: Cannot find module '/root/webapi/Presenters/RegisterUserPresenter'
on the line of import
:
import { RegisterUserPresenter } from "../Presenters/RegisterUserPresenter"
node --experimental-specifier-resolution=node build/src/webapi/server.js
does the job!