Boss machine project npm ERR! ERESOLVE unable to resolve dependency tree

Boss machine project link
https://www.codecademy.com/paths/back-end-engineer-career-path/tracks/wdcp-22-build-a-back-end-with-express-js/modules/wdcp-22-boss-machine/informationals/bapi-p4-boss-machine

I download the boss machine project then npm install which errors, what should I do next?

Debug log

# npm resolution error report

2022-04-23T16:53:05.380Z

While resolving: build-apis-boss-machine@1.0.0
Found: redux@3.7.2
node_modules/redux
  dev redux@"^3.7.2" from the root project

Could not resolve dependency:
peer redux@"^4" from redux-thunk@2.4.1
node_modules/redux-thunk
  dev redux-thunk@"^2.2.0" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "redux",
    "version": "3.7.2",
    "whileInstalling": {
      "name": "build-apis-boss-machine",
      "version": "1.0.0",
      "path": "/Users/someUser/projects/codecademy/bossMachine"
    },
    "location": "node_modules/redux",
    "isWorkspace": false,
    "dependents": [
      {
        "type": "dev",
        "name": "redux",
        "spec": "^3.7.2",
        "from": {
          "location": "/Users/someUser/projects/codecademy/bossMachine"
        }
      }
    ]
  },
  "currentEdge": {
    "type": "dev",
    "name": "redux",
    "spec": "^3.7.2",
    "from": {
      "location": "/Users/someUser/projects/codecademy/bossMachine"
    }
  },
  "edge": {
    "type": "peer",
    "name": "redux",
    "spec": "^4",
    "error": "INVALID",
    "from": {
      "name": "redux-thunk",
      "version": "2.4.1",
      "whileInstalling": {
        "name": "build-apis-boss-machine",
        "version": "1.0.0",
        "path": "/Users/someUser/projects/codecademy/bossMachine"
      },
      "location": "node_modules/redux-thunk",
      "isWorkspace": false,
      "dependents": [
        {
          "type": "dev",
          "name": "redux-thunk",
          "spec": "^2.2.0",
          "from": {
            "location": "/Users/someUser/projects/codecademy/bossMachine"
          }
        }
      ]
    }
  },
  "strictPeerDeps": false,
  "force": false
}

1 Like

After some reading found that if I changed package.json lines from

"redux": "^3.7.2",
"redux-thunk": "^2.2.0"

to

"redux": "3.7.2",
"redux-thunk": "2.2.0"

Lots of deprecated warnings however npm install did complete and I could get tests to run. Also these were helpful

7 Likes

I encountered the same problem and would have been stuck were it not for your answer. Thanks for sharing.

2 Likes

Oh man, thank you so much!!! I was really struggling with the same errors until I saw your post!

2 Likes

Thank you for doing the research on this.

This was helpful. thanks !

Thank you so much!!!