How to use nodemon when run nest project ?
** i want to reload server-side when edit code in nest project without npm run start again.
npm run start:dev
npm run start:dev
gives me
internal/modules/cjs/loader.js:716
throw err;
^
Error: Cannot find module '/Users/Rygar/Desktop/my-project/back-end/dist/main.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:713:15)
at Function.Module._load (internal/modules/cjs/loader.js:618:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
i also had this issue; it now works for me
one problem was that I did not correctly refer to files:
// wrong: import { ExcelController } from 'src/routes/ExcelController';
// seemingly correct: import { ExcelController } from '../routes/ExcelController';
my start:dev in package.json looks as follows:
tsc-watch -p tsconfig.build.json --onSuccess \"node dist/main.js\"
another thing: please delete your "dist" folder and recreate it with
npm run build
there may be disturbing stuff in your dist...
keen to read what helped in your case
have fun,
mario
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
npm run start:dev