Solve the problem that node process running in linux system cannot kill the process

  • 2021-07-22 12:16:46
  • OfStack

Let's first introduce that the node process running in the linux system cannot kill the process. The specific contents are as follows:


events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1039:14)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
at EventEmitter.listen (/root/webServer/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/root/webServer/express.js:46:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

I opened a port of 8888 before, which can be accessed. Later, shell died, and 8888 can still be accessed. After that, the service of port 8888 is newly run

Reported the above error

Solution: pkill node

Knowledge point extension: Linux kills/starts node process

Linux Kills node Process

sudo pkill node

Linux starts node project


sudo nohup node xxx.js
sudo nohup node xxx.js > xxx.txt 2>&1 &

Summarize


Related articles: