MongoDB setup with node.js: Error: failed to connect to [localhost:27017] MongoDB setup with node.js: Error: failed to connect to [localhost:27017] mongoose mongoose

MongoDB setup with node.js: Error: failed to connect to [localhost:27017]


Just for my curiousity, can you do

npm install mongoose

and also post the output from

ps -ef | grep mongod

All on the the machine you are running node from. That would go a long way towards the rest of an answer.

Also follow the simple sample code right after here, substitute the database name and a collection name and run that on node

node sample.js

Edit your post to include more information. It will all help.


just start mongo server or run on mongo.exe and type

mongod

then

mongo