Nest app is not starting with npm run start (:dev)

See original GitHub issue

I’m submitting a…


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Sometimes, when I run e.g. npm run start:dev then Nest.js is not starting.

[nodemon] 1.18.6
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: C:\Users\kvn\workspace\kargo\kargo-client-be\src/**/*
[nodemon] starting `ts-node -r tsconfig-paths/register src/main.ts`

That’s all what is coming for more than 10 minutes. I think it has something to do with performance and the scale of the project. My projects has around 30 modules.

I found a solution: I open my app.module.ts and comment almost every of my module, to make the app more lightweight. Then it runs again, and I remove every module step by step from comment block.

Module({
  providers,
  imports: [
    ConfigModule,
    MailModule,
    // ContactModule,
    // AuthModule,
    // CompanyModule,
    // AccountModule,
    // ProductModule,
  ],
  controllers: [AppController],
})
export class AppModule {}

Expected behavior

It should just start.

Minimal reproduction of the problem with instructions

I guess you can reproduce it with any bigger Nest.js project and a not so good PC/Notebook.

What is the motivation / use case for changing the behavior?

Well, people with less good PC/Notebooks can’t work on my project.

Environment


Nest version: 5.4.0

 
For Tooling issues:
- Node version: 10.14.1  
- Platform:  Win 10 64x Home, 16 GB RAM, i7 6 Generation

Others:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (8 by maintainers)

github_iconTop GitHub Comments

24reactions
itskemocommented, Jun 21, 2019

Simply make the following changes to config files in order to get npm run start:dev working again:

package.json

"start:dev": "concurrently --handle-input \"wait-on dist/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ", "start:dev": "concurrently --handle-input \"wait-on dist/src/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ",

nodemon.json

"exec": "node dist/main""exec": "node dist/src/main"

image

11reactions
karocksjoeleecommented, May 28, 2019

I am facing same issue , after created project using nest-cli . After I “npm run start:dev” , my terminal just show : Starting compilation in watch mode … just it , no other [nodemon] or [Nest] related message .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nest js: npm run start fails - Stack Overflow
I'm running Node v12.14.1 and npm v6.13.4 on a MacBook Pro 13", ... npm run start (NestJS) or npm run dev (NextJS) ,...
Read more >
First steps | NestJS - A progressive Node.js framework
With npm installed, you can create a new Nest project with the following commands ... This command starts the app with the HTTP...
Read more >
Troubleshooting Node.js Deploys - Heroku Dev Center
Your Node.js deploy failed - now what? Start with these simple steps to troubleshoot a build issue. Check the buildpack. Is the app...
Read more >
Getting Started with NestJS. Application overview, Installation
Experience in working with NodeJS, ExpressJS, Typescript (Not a ... npm run start:dev => Runs your application in development mode; npm run build...
Read more >
npm start not working in vs code terminal - You.com
When all else fails, remove/reinstall node.js completely. When you get wild errors all over the board on all of your node env commands,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found