Getting Error: Cannot find module 'x' after building nodejs

Viewed 19

I build nodejs with npm run build This is my scripts in package.json file

"scripts": {
    "build": "tsc",
    ...
}

Now its build in ../dist/server folder.

When i run node index.js, its getting

Cannot find module 'express'

When i installed express using npm i express, and run again, its getting

Cannot find module 'mongoose'

So, none of the dependency packages are installed on build!! Why is this?!

This is my tsconfig.json file. Incase you need enter image description here

0 Answers
Related