Nodejs failed to connect mongodb

  node.js, question

A few days ago, I made a blog that can send articles in python. I recently learned nodejs and am going to do it again in nodejs. However, when I connected MongoDB, I had a big problem.
Whether I use mongo or mongoose, I will prompt

{ [MongoError: failed to connect to server [localhost:27017] on first connect]
 name: 'MongoError',
 message: 'failed to connect to server [localhost:27017] on first connect' }

First of all, O(∩_∩)O~

1. My MongoDB is on, version 2.0.0. And you can use the mongo connection that MongoDB comes with.
My system is Windows Xp.
3. I can connect MongoDB with python
4.mongoose Version: 4.5.7 “

Post the code

var mongoose = require('mongoose');
 Log ('database connection error!'  );
 Log ('error message: \n\t');
 console.log('Success!  !  !'  );

I tried to delete mongod.lock and try mongodb:// connection. Is it a problem with xp? Or is it a question of connection rights? Please advise the great god! ! ! …

Starting in version 2.2, MongoDB does not support Windows XP. Please use a more recent version of Windows to use more recent releases of MongoDB.

Although it is curious where you found the version 2.0, it was probably 4 or 5 years ago. However, if you really want to use it this way, you need to find a corresponding 2.0 driver.