gpt4 book ai didi

javascript - 端口未释放(nodemon)

转载 作者:行者123 更新时间:2023-12-04 19:07:06 29 4
gpt4 key购买 nike

我正在使用 nodemon 重新加载我的服务器,但是当我保存文件时它会抛出一个错误,
它说该端口已被另一个进程使用。
这是错误:

events.js:174
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1280:14)
at listenInCluster (net.js:1328:12)
at Server.listen (net.js:1415:7)
at Function.listen (/home/yamil/code/tasksApp/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/home/yamil/code/tasksApp/index.js:23:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1307:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
[nodemon] app crashed - waiting for file changes before starting...
pd:我使用的是 Ubuntu 20.04.2

最佳答案

使用此命令终止监听端口的所有程序:

lsof -ti tcp:3000 | xargs kill

关于javascript - 端口未释放(nodemon),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66511635/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com