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

start command not working #1

Open
maks-novikov opened this issue Apr 5, 2018 · 3 comments
Open

start command not working #1

maks-novikov opened this issue Apr 5, 2018 · 3 comments

Comments

@maks-novikov
Copy link

Hi, i installed all modules and run "npm start" but it throws Error: [nodemon] 1.17.3
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node server.js
Could not connect to mongo server!
{ Error: Trying to open unclosed connection.
at NativeConnection.Connection._handleOpenArgs (C:\Users\User\Documents\Node-Projects\chat-example\Chat\node_modules\mongoose\lib\connection.js:214:11)
at NativeConnection. (C:\Users\User\Documents\Node-Projects\chat-example\Chat\node_modules\mongoose\lib\connection.js:309:37)
at NativeConnection.deprecated [as open] (internal/util.js:52:15)
at Mongoose.connect (C:\Users\User\Documents\Node-Projects\chat-example\Chat\node_modules\mongoose\lib\index.js:268:47)
at Object. (C:\Users\User\Documents\Node-Projects\chat-example\Chat\model\model.js:15:10)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\User\Documents\Node-Projects\chat-example\Chat\controller\controller.js:1:76)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32) state: 2 }
(node:21828) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/4.x/docs/connections.html#use-mongo-client
Node Server is setup and it is listening on http://192.168.1.22:8080
Could not connect to mongo server!
{ MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (C:\Users\User\Documents\Node-Projects\chat-example\Chat\node_modules\mongodb-core\lib\topologies\server.js:336:35)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection. (C:\Users\User\Documents\Node-Projects\chat-example\Chat\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket. (C:\Users\User\Documents\Node-Projects\chat-example\Chat\node_modules\mongodb-core\lib\connection\connection.js:189:49)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
name: 'MongoError',
message: 'failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }

@sudheeshshetty
Copy link
Owner

there is some issue with connecting to mongo. Is mongo running?

@jajosheni
Copy link

I have the same problem, any solution?

@theanmolsharma
Copy link

Try doing this.
MongoDB Atlas -> NetworkAccess -> Edit -> Allow Any

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

4 participants