Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
109
Help us understand the problem. What is going on with this article?
@kkam0907

node.js起動時エラー : Error: listen EADDRINUSE

More than 1 year has passed since last update.

事象

さっき動いていたのに、
node app.jsで起動しようとしたら、下記エラーが。

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at Server.listen (net.js:1138:5)
    at Function.app.listen (/vagrant/girly/girly-batch/node_modules/express/lib/application.js:532:24)
    at Object.<anonymous> (/vagrant/girly/girly-batch/bin/www:7:18)
    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)

原因

すでにそのポート使ってるよって怒られいるんです。

解決

既存プロセスを探して死んでもらう。
再度起動する。

$ ps aux | grep node
vagrant  14761  0.0  2.0 704016 38520 pts/0    Sl+  01:22   0:01 node app.js
vagrant  15069  0.0  0.0 107456   908 pts/2    S+   01:59   0:00 grep --color=auto node

$ sudo kill -9 14761
$ node app.js
109
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
109
Help us understand the problem. What is going on with this article?