• 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以管理员权限进行开启软件,这种情况看个人了,还是看你们具体情况而定,希望能帮到你们,本人笔记

  • 相关阅读:
    小学生python游戏编程arcade----灯光示例
    PNG怎么转换成PDF?这篇文章教会你
    RabbitMQ
    day30 SQL注入&CTF&二次&堆叠&DNS带外
    第十二章 配置 Apache 以与 Web 网关配合使用 (Windows)
    解密企业级PPPoE:部署、配置和管理的最佳实践
    EN 1504-5混凝土结构保护和修理用产品混凝土喷射—CE认证
    ts重点学习138-ts.config.json笔记
    CentOS6.6安装Cloudera Manager5.4的问题
    如何与墨西哥大众VW Mexico建立EDI连接
  • 原文地址:https://blog.csdn.net/yyh231366/article/details/128084258