Build failure: Error: listen EADDRINUSE: address already in use:::4000

Asked 2 years ago, Updated 2 years ago, 61 views

Thank you for your help.
I am having trouble with the following error when running the Node application that I am transferring to the system.I would appreciate it if you could help me.

$pm2-runtime start process.json
2019-02-06 00:45:50:PM2 log:Launching in no daemon mode
2019-02-06 00:45:50:PM2 log:App [graphql:0] starting in-fork mode-
2019-02-06 00:45:50:PM2 log:App [graphql:0] online
Error: listen EADDRINUSE: address already in use:::4000
    at Server.setupListenHandle [as_listen2] (net.js:1255:14)
    at listenInCluster (net.js:1303:12)
    at Server.listen (net.js:1391:7)
    at/var/www/html/kotsu.fuzuki-crm.jp-backend/node_modules/graphql-yoga/src/index.ts:365:22
    at new Promise (<anonymous>)
    at GraphQLServer.start (/var/www/html/kotsu.fuzuki-crm.jp-backend/node_modules/graphql-yoga/src/index.ts:363:12)
    at Object.<anonymous>(/var/www/html/kotsu.fuzuki-crm.jp-backend/src/index.js:51:8)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at loader(/var/www/html/kotsu.fuzuki-crm.jp-backend/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as.js] (/var/www/html/kotsu.fuzuki-crm.jp-backend/node_modules/babel-register/lib/node.js: 154:7)
    at Module.load (internal/modules/cjs/loader.js: 620:32)
    atryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous>(/var/www/html/kotsu.fuzuki-crm.jp-backend/src/index2.js:6:1)
2019-02-06 00:45:53:PM2 log:App [graphql:0]exited with code [1] via signal [SIGINT]

I did my own research to find out if the address was occupied.

$ps aux | grep node

As a result, none occupies 4000 ports, and no clue has been found.
Thank you for your cooperation.

linux node.js npm

2022-09-30 16:22

1 Answers

Perform the following:
lsof-i:4000
kill-9PID because you know the ID of the duplicate process.


2022-09-30 16:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.