简体   繁体   中英

node.js calling child_process.fork reports 'Error: listen EADDRINUSE'

when the 'child_process.fork( './driver' ,' runs over , an error occurs :

Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Agent.Server._listen2 (net.js:1156:14)
    at listen (net.js:1182:10)
    at Agent.Server.listen (net.js:1267:5)
    at Object.start (_debugger_agent.js:20:9)
    at startup (node.js:86:9)
    at node.js:814:3

And the log doesn't print its log , so ,the child process does not run ,right? How to debug this problem , I am using windows 7 .

Thanks

I think you are running on Visual Studio.

The error clearly Says Debugger Port is already in use.

If you change to any other port say 9999 (as below) or any other free port before forking it should work fine.

process.execArgv = ["--debug=9999"];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM