• nestjs listen EADDRINUSE: address already in use :::3000


    开发过程中,你会遇到这样一种错误:

    [Nest] 13804  - 2022/11/28 17:45:18     LOG [RouterExplorer] Mapped {/, GET} route +2ms
    [Nest] 13804  - 2022/11/28 17:45:18     LOG [NestApplication] Nest application successfully started +2ms
    [Nest] 13804  - 2022/11/28 17:45:18   ERROR [NestApplication] Error: listen EADDRINUSE: address already in use :::3000 +2ms
    [Nest] 13804  - 2022/11/28 17:45:18     LOG [NestApplication] Nest application successfully started +2ms
    [Nest] 13804  - 2022/11/28 17:45:18   ERROR [NestApplication] Error: listen EADDRINUSE: address already in use :::3000 +2ms
    (node:13804) UnhandledPromiseRejectionWarning: Error: listen EADDRINUSE: address already in use :::3000
        at Server.setupListenHandle [as _listen2] (net.js:1331:16)
        at listenInCluster (net.js:1379:12)
        at Server.listen (net.js:1465:7)
        at ExpressAdapter.listen (D:\nest\demo100\node_modules\@nestjs\platform-express\adapters\express-adapter.js:78:32)
        at D:\nest\demo100\node_modules\@nestjs\core\nest-application.js:167:46
        at new Promise ()
        at NestApplication.listen (D:\nest\demo100\node_modules\@nestjs\core\nest-application.js:156:16)
        at bootstrap (D:\nest\demo100\src\main.ts:6:3)(Use `node --trace-warnings ...` to show where the warning was created)(node:13804) 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:13804) [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.

    可能部分百度是这样说的,是端口错误,百度说的没有错,就是端口被占用

    于是你输入了指令

    netstat -ano|findstr 3000

    taskkill /pid 14236

    然后你发现终止失败,没有权限等

    其实这种情况你输入

    taskkill /f /pid 14236就行了 记住端口号自己改

    另外就是有可能有的电脑权限不一样,你可以尝试用vscode以管理员权限进行开启软件,这种情况看个人了,还是看你们具体情况而定,希望能帮到你们,本人笔记

  • 相关阅读:
    智能化小区管理系统(JSP+java+springmvc+mysql+MyBatis)
    cos 腾讯云直传
    OpenGL - Deferred Rendering
    半导体新能源智能装备整机软件系统方案设计
    深入浅出排序算法之计数排序
    Java.lang.Class类 getDeclaredConstructors()方法有什么功能呢?
    只需5分钟,完成Redis所有命令操作~
    图形学学习笔记
    软件设计师2011上午题基础知识(易错整理)
    秋招/考研面试-操作系统
  • 原文地址:https://blog.csdn.net/yyh231366/article/details/128084258