% hexo server AL Port 4000 has been used. Try other port instead. FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html Error: listen EADDRINUSE: address already in use :::4000 at Server.setupListenHandle [as _listen2] (net.js:1309:16) at listenInCluster (net.js:1357:12) at Server.listen (net.js:1445:7) at /Users/devsawd/blog/node_modules/hexo-server/lib/server.js:69:12 at Promise._execute (/Users/devsawd/blog/node_modules/bluebird/js/release/debuggability.js:384:9) at Promise._resolveFromExecutor (/Users/devsawd/blog/node_modules/bluebird/js/release/promise.js:518:18) at new Promise (/Users/devsawd/blog/node_modules/bluebird/js/release/promise.js:103:10) at checkPort (/Users/devsawd/blog/node_modules/hexo-server/lib/server.js:66:10) at Hexo.module.exports (/Users/devsawd/blog/node_modules/hexo-server/lib/server.js:18:10) at Hexo.tryCatcher (/Users/devsawd/blog/node_modules/bluebird/js/release/util.js:16:23) at Hexo.<anonymous> (/Users/devsawd/blog/node_modules/bluebird/js/release/method.js:15:34) at /Users/devsawd/blog/node_modules/hexo/lib/hexo/index.js:248:17 at Promise._execute (/Users/devsawd/blog/node_modules/bluebird/js/release/debuggability.js:384:9) at Promise._resolveFromExecutor (/Users/devsawd/blog/node_modules/bluebird/js/release/promise.js:518:18) at new Promise (/Users/devsawd/blog/node_modules/bluebird/js/release/promise.js:103:10) at Hexo.call (/Users/devsawd/blog/node_modules/hexo/lib/hexo/index.js:244:12) at /usr/local/lib/node_modules/hexo-cli/lib/hexo.js:67:17 at tryCatcher (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird/js/release/promise.js:729:18)
에러 내용은 4000번 포트가 이미 사용되고 있다는겁니다. 4000번 포트를 사용중인 프로세스를 먼저 찾아봐야겠네요.
1 2 3
% lsof -i :4000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 43609 devsawd 42u IPv6 0x1a23ef236800be15 0t0 TCP *:terabase (LISTEN)
PID의 43609번이 사용중으로 확인됩니다. kill 명령어로 해당 프로세스를 종료시킨 후
1
%kill -9 43609
1
% hexo server
hexo server 명령어를 이용해 재구동 하니 정상적으로 사용할 수 있습니다.
address already in use에러는 port를 사용하는 프로세스를 다룰때 자주 볼 수 있는 에러입니다. 간단히 해당 프로세스를 종료시켜 문제를 해결할 수 있습니다.