Closed ralyodio closed 10 years ago
Make sure you're running MongoDB.
After installing it, run mongod
then grunt serve
that was it. thanks.
@ibeitia i built my project without mongo (which I think was a prompt question at the beginning of the generator questions, and i said no to Mongo), because the application requires no database.
I get the undefined error when starting the application. What would be the right way to handle the issue in this scenario?
mongod is running, but no matter what I do I still get this error of:
Express server listening on undefined:9000, in development mode
Running "serve" task
Running "clean:server" (clean) task
Cleaning .tmp...OK
Running "bower-install:app" (bower-install) task
Running "concurrent:server" (concurrent) task
Running "compass:server" (compass) task
directory .tmp/styles/
create .tmp/styles/main.css (0.014s)
Compilation took 0.014s
Done, without errors.
Execution Time (2014-05-21 05:13:28 UTC)
compass:server 450ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
Total 454ms
Running "autoprefixer:dist" (autoprefixer) task
Prefixed file ".tmp/styles/main.css" created.
Running "express:dev" (express) task
Starting background Express server
debugger listening on port 5858
Express server listening on undefined:9000, in development mode
Running "open:server" (open) task
finished populating things
db connection open
finished populating users
Running "watch" task
Waiting...
This is a brand new project with fresh install of the generator. Not sure what i'm missing here...
@chair9design - are you able to access the site (i.e. http://localhost:9000/) once the server starts?
The undefined
in Express server listening on undefined:9000, in development mode
is a bug, but I believe it's only an issue with this log message, not an issue with starting the server.
Let me know if this assumption is wrong, and we can continue to debug.
adding it to all.js
seemed to do the trick for me, but like you said it doesn't seem to be necessary at the same time, because once I got past the undefined:9000 error, the conflict I ran into next was the fact that I also had php-fpm
listening on port 9000
which was causing this error... http://stackoverflow.com/questions/16827987/expressjs-throw-er-unhandled-error-event
I found what was running on port 9000 by running this command.
sudo lsof -i :9000
Then confirmed nothing was running on 3000 by changing the above command to:
sudo lsof -i :3000
Once I new 3000 was a safe port, I changed the port to 3000 in my grunt file's express
options, as well as, the all.js
exports definition
port: process.env.PORT || 3000,
Now all is well and seeing 'Allo, 'Allo ! ... hopefully this helps someone else out.
see above, but to directly answer your question about the server running despite the error message, the answer was no, but that seems to be primarily because I'm running php-fpm on port 9000 so I can reverse proxy some php sites via NGINX. Once I switched the port the server started up. The console log still says undefined, but the app started up once the port was changed, so your commit seem like it will fix the console.log in the server.js
file on app start.
In ./config/development.js add this line:
ip: 'localhost'
that should fix the problem.
adding ip: 'localhost'
was the first route I went, but that didn't fix the issue only because port 9000 wasn't free since php-fpm
was already listening on this port otherwise simply adding the ip
property to the ./config/development.js
file should have done the trick. But in all actuality, this isn't even needed because the app starts without it, it's just that there is an undefined logged value on app startup in server.js
when it's not added to development.js
Express server listening on undefined:9000, in development mode
and app crashes right away when running
grunt serve