connect-mongo package incompatible with mongodb version

Viewed 300

I don't know how to describe this error, when i type npm i connect-mongo i got this error.I think it incompatible with my mongodb version (5.0.5), is it right?

npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: typeorm@0.2.43
npm ERR! Found: mongodb@4.4.0
npm ERR! node_modules/mongodb
npm ERR!   peer mongodb@"^4.1.0" from connect-mongo@4.6.0
npm ERR!   node_modules/connect-mongo
npm ERR!     connect-mongo@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional mongodb@"^3.6.0" from typeorm@0.2.43
npm ERR! node_modules/typeorm
npm ERR!   dev typeorm@"^0.2.43" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: mongodb@3.7.3
npm ERR! node_modules/mongodb
npm ERR!   peerOptional mongodb@"^3.6.0" from typeorm@0.2.43
npm ERR!   node_modules/typeorm
npm ERR!     dev typeorm@"^0.2.43" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

this is my package.json

"scripts": {
    "start": "node dist/index.js",
    "server": "nodemon dist/index.js",
    "start-ts": "ts-node src/index.ts",
    "watch": "tsc -w",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@types/express-session": "^1.17.4",
    "@types/node": "^17.0.17",
    "apollo-server-core": "^3.6.3",
    "apollo-server-express": "^3.6.3",
    "argon2": "^0.28.4",
    "class-validator": "^0.13.2",
    "dotenv": "^16.0.0",
    "express": "^4.17.2",
    "express-session": "^1.17.2",
    "graphql": "^15.8.0",
    "nodemon": "^2.0.15",
    "pg": "^8.7.3",
    "reflect-metadata": "^0.1.13",
    "type-graphql": "^1.1.1",
    "typescript": "^4.5.5"
  },
  "devDependencies": {
    "@types/express": "^4.17.13",
    "@types/validator": "^13.7.1",
    "ts-node": "^10.5.0",
    "typeorm": "^0.2.43"
  }

how can I fix it and if I get a error which similar this error, how should I ask?

0 Answers
Related