my project's routes return 404 when WebStorm 7.0.1 is open - node.js

This is the situation:
WebStorm is open.
I run node app.js
I get : Server is listening on port 7777
I open chrome, and go to: localhost:7777.
I get: 404 Not Found WebStorm 7.0.1
when I close webstorm and do the same things everything works fine.
Anybody can help?
Thnx

You might have an instance of node already running: ps aux | grep node. If you do kill it and then use webstorm for running node.

OK,
The Webstorm Support helped me out...
My built-in server port was 7777. I changed this setting to another number and now everything works...

Related

Ember Server: "Port 4200 is already in use", when no process runs on 4200

When running my ember application with ember serve -e local I get:
Port 4200 is already in use.
Which is weird because no application is running on 4200. I tried to open a dummy HTTP server on 4200 with http-server and it works just fine. It also works when I specify the port via a command line flag ember serve --port 4200.
Some things I've tried:
Restarted my computer.
Removed the node_modules.
Remove the ember tmp directory.
Disabled my firewall.
Tried with disabled wi-fi.
Any thoughts?
I'm running on masOS High Sierra 10.13.6 with the following versions:
node: 8.11.3
ember-cli: 2.18.2
npm: 5.6.0 (also tried with 6.3.0)
Also useful to know:
I have other ember applications running on my computer just fine.
I started to have this problem only recently.
In the past, macOS would keep asking me about authorizing incoming traffic whenever an app was opened, but now it stopped asking me.
I had this issue and tracked it down to using a string vs. integer for port in .ember-cli.
// .ember-cli
{
"port": 8080, // works
"port": "8080", // throws the error mentioned above
}
Not sure if this is the cause for others with this error. As mentioned, first thing is to make sure nothing else is actually running on that port. But OP had already checked that, and so had I.
After further investigation, it seems that the problem is not coming from macOS, but from something messed up in the dependencies causing ember-cli to fail...
It's not quite clear what is causing this, and I will try to post any additional information here, but for now if you happen to encounter this problem, just pass the port value directly to ember-cli like so:
ember serve --port 4200

Connection refused while using debugger

I have attached a node debugger to my JS file and after attaching the debugger to the js file which is a server running on port 8080 while I try to access it using localhost - it gives the following error message:
The node version is v6.11.2 and the debugger which gets attached is the one comes with the node(default) like
node debug JSONServer.js
The module used in the file are core modules http and https and the OS of the machine is Windows 10
connection refused
Please suggest what can be the reason.
Thanks
All,
Later I tried running the debugger from Atom with the package node-debugger
Still it gave same error
Connection Refused
Then I tried to attach the debugger outside Atom with following command
node --debug=5858 JSONServer.js
And Opened the debugger in Atom and this time the Debugger worked in Atom.

localhost:3000 connection refused after app.js is set (Windows 7)

I've followed this manual of installing MEAN stack https://thecodebarbarian.wordpress.com/2013/07/22/introduction-to-the-mean-stack-part-one-setting-up-your-tools/
and I got stuck on the point where I should be able reach for localhost:3000 successfully, but instead I get ERR_CONNECTION_REFUSED. I checked the ports using
netstat -an
and it seems my port 3000 is not even open. My Apache is working on port 80 and after reaching for localhost:80 everything works fine (I even checked if closing the Apache helps). The only thing I changed in the manual is that I installed both express and express-generator thanks to this install express with npm.
Can anybody tell me what should I do additionally so my port 3000 responds?
EDIT: I also checked the host files in system32, the only localhost address I have is 127.0.0.1 (three times, though!)
EDIT2: Solved, same issue as here: Express Node.js doesn't work
Remember to change the app.js file in the folder you are currently working in!

Error: listen EADDRINUSE when trying to run an Express.js application?

When I try to run my application an Express.js server, the first time with a new port works fine, but then when I try to run it again on that port, I get the "Error: listen EADDRINUSE" error.
I already tried killing all the possible node/gulp processes, also, checked netstat and I do not see port 8080 being used by anything.
What could be the culprit?
This usually happens if the node process is still running your app when you go to run it again. Express will try to bind to the same port but it's already being use by the last node instance you created.
Kill all node processes and try again.
I know that this post is very old. But right now I saw something.
When I was in the same situation as you are in, I opened the console in my browser and I can see some errors. When I solved those errors, everything works fine.

Debugging node.js apps in WebStorm 7

I am having a strange issue debugging node.js apps in WebStorm 7.
The first time I start the debugger I get the application running:
/usr/bin/node --debug-brk=34041 app.js
debugger listening on port 34041
Current Environment: development
Express server listening on port 3000
But, after the first time (or if I restart the debugger), I get the debugger running but not the app, like below:
/usr/bin/node --debug-brk=42140 app.js
debugger listening on port 42140
or
/usr/bin/node --debug-brk=51341 app.js
debugger listening on port 51341
I need to restart the WebStorm itself in order to debug the app again.
Is it a bug in WebStorm?
Is it a bug in Node.js?
Is there a way to make it work properly?
After contacting the support, I found that it was a bug in the WebStorm, already fixed in version 7.0.1.

Resources