TCPServer Error: Address already in use - bind(2)

后端 未结 8 1147
无人共我
无人共我 2020-12-07 07:38

Jekyll was working fine for me few weeks back but now all of a sudden it gives me the following error:

TCPServer Error: Address already in use - bind(2)
INFO         


        
8条回答
  •  悲&欢浪女
    2020-12-07 08:13

    I was not qualified to post comment. So I added a new answer.

    I encountered this problem on Mac OS X 10.10.3. And I had never installed/used Jekyll before. I was not able to start jekyll server with its default port number 4000. The reason was that the port was the same as what NoMachine used. With

    $ sudo lsof -wni tcp:4000
    

    Note: Running this command without sudo will have no output.

    I saw this output:

    COMMAND PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    nxd     449   nx    3u  IPv4 0x8d22************      0t0  TCP *:terabase (LISTEN)
    nxd     449   nx    4u  IPv6 0x8d22************      0t0  TCP *:terabase (LISTEN)
    

    The port 4000 was occupied by nxd, which was the process started by NoMachine. And

    $ sudo kill -9 449
    

    would not work, because NoMachine's nxd process would keep restarting, with a new PID.

    Therefore, I had to either:

    • Changed my jekyll server port in the site _config.yml to another spared one. I appended the line below to _config.yml and it worked.

      port: 3000 # change server port to 3000

    or

    • Changed NoMachine's default nxd port, or Uninstall NoMachine

提交回复
热议问题