Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
106
rated 0 times [  112] [ 6]  / answers: 1 / hits: 21879  / 10 Years ago, sat, february 22, 2014, 12:00:00

i just installed node.js on Amazon EC2, and everything was working fine, then i stopped the server, and tried to start it again, and now i am getting this error:



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 Object.<anonymous> (/home/CloudChat/server.js:34:24)
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)
at Function.Module.runMain (module.js:497:10)
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the application-name package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls application-name
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.4.73-64.112.amzn1.x86_64
npm ERR! command node /usr/local/bin/npm start
npm ERR! cwd /home/CloudChat
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/CloudChat/npm-debug.log
npm ERR! not ok code 0


npm-debug.log contains this:



0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 error [email protected] start: `node server.js`
9 error Exit status 8
10 error Failed at the [email protected] start script.
10 error This is most likely a problem with the application-name package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node server.js
10 error You can get their info via:
10 error npm owner ls application-name
10 error There is likely additional logging output above.
11 error System Linux 3.4.73-64.112.amzn1.x86_64
12 error command node /usr/local/bin/npm start
13 error cwd /home/CloudChat
14 error node -v v0.10.26
15 error npm -v 1.4.4
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]


All i did was rename app.js to server.js, i also changed it in package.json, but it worked right after, until i stopped the server?



**EDIT** 

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address Stat e
tcp 0 0 *:webcache *:* LIST EN
tcp 0 0 *:ssh *:* LIST EN
tcp 0 0 *:hbci *:* LIST EN
tcp 0 0 localhost:smtp *:* LIST EN
tcp 0 320 ip-172-31-34-214.us-wes:ssh 78-143-78-51-customer.:6639 ESTA BLISHED
tcp 0 0 ip-172-31-34-214.us-wes:ssh 78-143-78-51-customer.:8846 ESTA BLISHED
tcp 0 0 ip-172-31-34-214.us-wes:ssh 78-143-78-51-customer.:8212 ESTA BLISHED
tcp 429 0 ip-172-31-34-214.u:webcache 78-143-78-51-customer.:8048 CLOS E_WAIT
tcp 0 0 ip-172-31-34-214.us-wes:ssh 78-143-78-51-custom:fs-mgmt ESTA BLISHED
tcp 0 0 *:ssh *:* LIST EN
udp 0 0 *:bootpc *:*
udp 0 0 ip-172-31-34-214.us-west:ntp *:*
udp 0 0 localhost:ntp *:*
udp 0 0 *:ntp *:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 6526 /var/run/dbus/system_bu s_socket
unix 2 [ ACC ] STREAM LISTENING 5537 @/com/ubuntu/upstart
unix 12 [ ] DGRAM 6469 /dev/log
unix 2 [ ACC ] SEQPACKET LISTENING 5611 @/org/kernel/udev/udevd
unix 3 [ ] STREAM CONNECTED 52862
unix 3 [ ] STREAM CONNECTED 52861
unix 2 [ ] DGRAM 52858
unix 2 [ ] DGRAM 44741
unix 2 [ ] DGRAM 44722
unix 3 [ ] STREAM CONNECTED 41225
unix 3 [ ] STREAM CONNECTED 41224
unix 2 [ ] DGRAM 41221
unix 3 [ ] STREAM CONNECTED 40807
unix 3 [ ] STREAM CONNECTED 40806
unix 2 [ ] DGRAM 40803
unix 2 [ ] DGRAM 40121
unix 3 [ ] STREAM CONNECTED 38240
unix 3 [ ] STREAM CONNECTED 38239
unix 2 [ ] DGRAM 38236
unix 2 [ ] DGRAM 11231
unix 2 [ ] DGRAM 7465
unix 2 [ ] DGRAM 7446
unix 2 [ ] DGRAM 7428
unix 2 [ ] DGRAM 7347
unix 3 [ ] STREAM CONNECTED 6535 /var/run/dbus/system_bu s_socket
unix 3 [ ] STREAM CONNECTED 6534
unix 3 [ ] STREAM CONNECTED 6530
unix 3 [ ] STREAM CONNECTED 6529
unix 3 [ ] DGRAM 5627
unix 3 [ ] DGRAM 5626
[root@ip-172-31-34-214 CloudChat]#

More From » node.js

 Answers
8

Here is how to shut down express if you happen to have the same situation as me:



ps aux | grep node
Find the process ID (second from the left):
kill -9 PRCOCESS_ID

[#72370] Friday, February 21, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
daren

Total Points: 577
Total Questions: 114
Total Answers: 120

Location: Malaysia
Member since Fri, Dec 3, 2021
3 Years ago
;