node -v
v0.10.25
npm --version
3.7.2
babel-node -V
6.5.1
なんか適当に開発してて babel-nodeしてたら EADDRINUSEとか言われた
Error: listen EADDRINUSE :::80
at Object.exports._errnoException (util.js:837:11)
at exports._exceptionWithHostPort (util.js:860:20)
at Server._listen2 (net.js:1231:14)
at listen (net.js:1267:10)
at Server.listen (net.js:1363:5)
at http_start (http.js:26:37)
at main (app.js:5:1)
at Object.<anonymous> (app.js:10:1)
at Module._compile (module.js:434:26)
at loader (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:128:5)
- 詳しく言うと2回目以降出る
- ググるとサーバーがポートを開いたままになってるからIN USEと怒るらしい
hoge.js
process.on('exit', () => サーバー名.close());
とかしてあげると解決。