I am currently facing an issue while trying to share models and functions between two separate typescript projects - nest.js and angular.js. To initiate this process, I have set up boilerplate nest.js and angular.js projects in folders named api
and ui
respectively. Additionally, I have created a folder called lib
which contains a single typescript file. Interestingly, Angular has no trouble importing typescript files from parent folders. However, nest.js encounters an error that reads as follows:
➜ api git:(master) npm run start
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="19786970592937293728">[email protected]</a> start
> nest start
Error: Cannot find module '/home/amir/workspace/nest-angular-monorepo/api/dist/main'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
npm ERR! Lifecycle script `start` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a0b1a032a5a445a54533c494e4853">[email protected]</a>
npm ERR! at location: /home/amir/workspace/nest-angular-monorepo/api
➜ api git:(master)