Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to local DB #2

Open
petre2dor opened this issue Mar 5, 2014 · 1 comment
Open

Cannot connect to local DB #2

petre2dor opened this issue Mar 5, 2014 · 1 comment

Comments

@petre2dor
Copy link

db.js contains:
module.exports = { url : 'mongodb://localhost/test' }

and I have mongodb installed: $ mongo --version MongoDB shell version: 2.4.6
when is start node server.js I get this:
connect.multipart() will be removed in connect 3.0 visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives connect.limit() will be removed in connect 3.0 The magic happens on port 8080 events.js:72 throw er; // Unhandled 'error' event ^ Error: failed to connect to [localhost:27017] at null.<anonymous> (/home/petre/Documents/work/starter-node-angular/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:553:74) at EventEmitter.emit (events.js:106:17) at null.<anonymous> (/home/petre/Documents/work/starter-node-angular/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15) at EventEmitter.emit (events.js:98:17) at Socket.<anonymous> (/home/petre/Documents/work/starter-node-angular/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10) at Socket.EventEmitter.emit (events.js:95:17) at net.js:440:14 at process._tickCallback (node.js:415:13)

What am I missing?

Thanks for the tutorial and the project!
Petre

@mattwarren1234
Copy link

I ran into the same problem initially!
Before starting node, go to the top level directory of your project and type
mongod
then run node server.js.
My bet is that it is trying to connect to mongo but mongo is not yet running.

bartschij added a commit to bartschij/starter-node-angular that referenced this issue Feb 20, 2019
Jaheeli added a commit to Jaheeli/starter-node-angular that referenced this issue Aug 6, 2020
Soliana14 pushed a commit to Soliana14/starter-node-angular that referenced this issue Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants