500 Internal Server Error for URL: http://localhost:8100/api/timeline - node.js

500 Internal Server Error for URL:http://localhost:8100/api/timeline dev4living/HeyCommunity
I am trying to run a dev4living/HeyCommunity webApp on a local host but i'm getting the following error:
Error: connect EADDRINUSE 127.0.0.1:8100
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
http://localhost:8100/
-i used the lastest update dev-playing : dev4living/HeyCommunity-backend and dev4living/HeyCommunity-frontendenter code here
-What should i do to fix this error?
-Your assistance will be very much appreciated.

The error states that the port you are trying to use is already occupied. Please check the app running in the port 8100 and stop that and try to run the app again. Changing the port number to something else apart from 8100 will also solve the problem.

The error is pretty self-explanatory buddy. It just means that the address you have used, i.e, the port number is currently in use by something else.
2 possible solutions:
Simply change the port number
using cmd to get the list of processes running. Identify the process running on that port. And use taskkill -pid command. Refer this stack overflow post for details regarding this method

Related

NodeJS: How to stop a web server?

I'm using the plugin gulp-server-livereload.
var server = require('gulp-server-livereload');
gulp.src(pathDir).pipe(server({
livereload: true,
directoryListing: true,
open: true,
port: 80
}));
How to stop the server?
I tried server.restart(), server.kill(), server.reset()
But always there are such errors:
Uncaught Error: listen EADDRINUSE 127.0.0.1:35729
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1262:14)
at listen (net.js:1298:10)
at doListening (net.js:1397:7)
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:1
0)
Please help me to solve my question or tell me another option how you can
implement what I need.
This error is occurring because of another process using the port. It is likely just a previous instance of this process, however it is possible that another application is using the port.
You will be unable to stop this using Node, as it is a process remaining from another run and processes do not have the permissions to 'manage' one another.
On Windows use task manager to kill the node process, on Mac you can use Activity Monitor, and on Unix/Linux you can use htop or similar.
Alternatively on Unix/Linux (incl. MacOS) you can use
sudo lsof -i :35729
to find the process id of the process ID using that port, then kill it:
kill -9 {PID}
To ensure your node server cleanly shuts down in future add event handlers:
process.on('SIGTERM', ..)
process.on('uncaughtException', ..)
and invoke code inside these to shut down your application.

light streamer nodejs hello world example throwing error

hello every one i am new in nodejs and want to use the light streamer for my site there is a example on git when i tried to deployed it on my local instance throwing the below error any idea will be appreciated thanks in advance...
here is the example i want to deploy
Light streamer nodjs example
E:\wamp\www\nodeJs\lightstream>node helloworld.js
events.js:85
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED
at exports._errnoException (util.js:746:11)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1000:19)
ECONNREFUSED suggests that the application is not able to connect to the desired TCP port (most likely it is being blocked by a firewall or there is no application listening on that port).
Assuming you have not changed the configuration in helloworld.js:
Have you installed the lightstream server locally and checked it is running? If so, check Windows Firewall and add rules to allow inbound ports 6663 and 6664.

NodeJS ExpressJS ETIMEDOUT net.js

came in on Monday morning and my node app is not working. No code changes have occurred recently. Users are receiving this error when trying to connect:
Error: connect ETIMEDOUT
at errnoException (net.js:901:11)
at Object.afterConnect [as oncomplete] (net.js:892:19)
Seems like something must have changed on the server, although I'm yet to figure out what it is. There was a power outage over the weekend. Any insights as to what would cause this? I receive the same error if I try to connect to my node app on the server itself, so it seems it can't be firewall related.
In case it's helpful to anyone else, the problem was that my backend database services had not restarted after the power outage. Not sure why this was the error thrown, but that's what solved it for me!

npm start giving error

I have installed KrakenJs on Windows 7. I have created project by using following command :
Yo Kraken
When I tried to run the project, it is giving following error (even after restarting system) :
E:\nodejs\test\kraken\Dust-01>npm start
> dust-01#0.1.0 start E:\nodejs\test\kraken\Dust-01
> node index.js
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
at bind (E:\nodejs\test\kraken\Dust-01\node_modules\kraken-js\index.js:139:33)
at _fulfilled (E:\nodejs\test\kraken\Dust-01\node_modules\kraken-js\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (E:\nodejs\test\kraken\Dust-01\node_modules\kraken-js\node_modules\
q\q.js:827:30)
at Promise.promise.promiseDispatch (E:\nodejs\test\kraken\Dust-01\node_modules\kraken-js\node_mo
dules\q\q.js:760:13)
at E:\nodejs\test\kraken\Dust-01\node_modules\kraken-js\node_modules\q\q.js:574:44
at flush (E:\nodejs\test\kraken\Dust-01\node_modules\kraken-js\node_modules\q\q.js:108:17)
E:\nodejs\test\kraken\Dust-01>
Can some one guide me what I am doing wrong and how it can be rectified
Look into next two possibilities:
Try opening your command prompt 'As Administrator', that shall solve the issue if you are lacking permissions to open port.
Temporarily change the port used in Kraken to something irregular and long, example: 32482
Then move on from this, if 1st - then you have solved an issue, if 2nd - you are very likely trying to open a port, which is already used by other application.

Node.js Unhandled 'error' event when using http.createServer().listen() on Ubuntu 12.04

Salam (means Hello) :)
I've developed a node.js script on my windows seven machine and it's working fine. but when I run it on my Ubuntu 12.04, the following error shows up and halts my app:
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
at Object.start (/httpServer/httpServer.js:9:34)
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)
and the point that caused error is .listen(80) in this line:
http.createServer(onRequest).listen(80);
^
I've also tried some other port numbers (like 100, 300, 500,...) instead of 80 and the error was still the same.
On Ubuntu you can't listen on ports < 1024 without root privileges. Try running node under sudo.
sudo node app.js
You probably have apache running on port 80, so it's conflicting.
Use another port (NOT within 0-1023), or disable apache.
Cheers
You probably have something else running on port 80, so it's conflicting.
Read here to find out what is using port 80 and stop it
http://www.cyberciti.biz/faq/find-linux-what-running-on-port-80-command/
Usually it means another server like apache is enabled. so stop it.
sudo service apache2 stop
or You have npm start already running in another terminal
or skype is running. in which case go to settings and change it's port. logout n login
Go to Tools -> Options -> Advanced -> Connections and uncheck the box "use port 80 and 443 as alternative".src
or use another port
http-server -a localhost -p 8000
I suggest to install the latest node packets, maybe directly from Node.js server, maybe compiling it.
Try to set a port which is not reserved to any service, like 3700.
Could be heplful to see some other fragment of code, though.
This can also be caused if you have something else already listening on that port - you can try changing the port from the typical default 80 to something more like 10014 and see if that helps!
I was able to rectify the error by explicitely mentionining the "IP address" along with the port when listening to the server.

Resources