Skip to content

Nestjs app errors out if run in dev mode. #391

@logesh-freshworks

Description

@logesh-freshworks

Describe the bug

Tried running Nestjs app in dev mode in the terminal. Its throwing the following error. The port is in use it seems.

(node:25) UnhandledPromiseRejectionWarning: Error: listen EADDRINUSE: address already in use :::3000
(Use `node --trace-warnings ...` to show where the warning was created)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:25) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C

Link to the blitz that caused the error

https://stackblitz.com/edit/nestjs-typescript-starter-rwk8zd?file=src%2Fapp.service.ts&terminal=start

Steps to reproduce

  1. Create a nestjs app
  2. open the terminal
  3. Run npm install
  4. Run start:dev
  5. Do some changes
  6. See the error in terminal

Expected behavior

Should restart the dev server when changes are made.

Screenshots

No response

Platform

Browser name  = Chrome 
Full version  = 95.0.4638.69
Major version = 95
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 111464709,
  "usedJSHeapSize": 105855925,
  "jsHeapSizeLimit": 4294705152
}
Hash = d83b9b15484f32317787d8c7cc41da5651102bdc

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions