9

I am receiving an error when to installing npm install react-bootstrap-table-next --save.

I do not not understand what it is telling me nor how to resolve, any guidance appreciated:

the error:

$ npm install react-bootstrap-table-next --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0" from [email protected]
npm ERR! node_modules/react-bootstrap-table-next
npm ERR!   react-bootstrap-table-next@"*" 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.

my dependencies:

  "dependencies": {
    "@testing-library/jest-dom": "^5.11.9",
    "@testing-library/react": "^11.2.3",
    "@testing-library/user-event": "^12.6.0",
    "axios": "^0.21.1",
    "bootstrap": "^4.6.0",
    "react": "^17.0.1",
    "react-bootstrap": "^1.4.3",
    "react-dom": "^17.0.1",
    "react-paypal-button-v2": "^2.6.2",
    "react-redux": "^7.2.2",
    "react-router-bootstrap": "^0.25.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.1",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "redux-thunk": "^2.3.0",
    "web-vitals": "^0.2.4"
  },

3 Answers 3

14

after some further digging the issue appears to be related to NPM v7, running the following resolved the issue:

npm install react-bootstrap-table-next --save --legacy-peer-deps

Key info is shown below and taken from the following posts:

unable-to-resolve-dependency-tree-reactjs

graphql-eresolve-unable-to-resolve-dependency

NPM v7

NPM v7 was recently released and this is the version that current (as of November 2020) node:current images use.

Probably the biggest changes brought about by NPM7 relate to peer dependencies - NPM should now be able to install them automatically, if possible. Read more here.

As described in the document, in cases where it's not possible to solve the conflicts, NPM should now throw errors rather than warnings, which is what you are seeing.

I, on the other hand, only managed to get warnings and no errors using your setup and NPM v7.0.8, and I don't know why. The problems reported were essentially the same, however, so the resolution ought to be very similar.

Sign up to request clarification or add additional context in comments.

Comments

0

I experienced the same error today on Mac. I solved it just by installing the latest version of NodeJs. I would recommend you try updating your "nodeJs" installation.

Comments

-1

i got the same issue in my project, and i try this..

visit https://github.com/react-bootstrap-table/react-bootstrap-table2/issues/989

npm install @types/react-bootstrap-table-next

1 Comment

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.