P
P
Polina Titova2020-12-30 10:52:48
JavaScript
Polina Titova, 2020-12-30 10:52:48

How to solve the problem with installing npm package?

I'm doing a project on Next.js - a framework for React.js. To work with the progress bar, I install the nextjs-progressbar npm package . An error is displayed in the terminal, what can it mean and how to solve this problem?

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   [email protected]"17.0.1" from the root project
npm ERR!   peer [email protected]"^16.6.0 || ^17" from [email protected]
npm ERR!   node_modules/next
npm ERR!     [email protected]"10.0.4" from the root project
npm ERR!     peer [email protected]"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0" from [email protected]
npm ERR!     node_modules/nextjs-progressbar
npm ERR!       [email protected]"*" from the root project
npm ERR!   1 more (react-dom)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer [email protected]"^16.0.0" from [email protected]
npm ERR! node_modules/nextjs-progressbar
npm ERR!   [email protected]"*" 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.
npm ERR! 
npm ERR! See /home/andrew/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/andrew/.npm/_logs/2020-12-30T07_49_58_318Z-debug.log

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Polina Titova, 2020-12-30
@poly-titova

Since the problem was with dependencies, it means that it was necessary to change a couple of versions. In this case like this:

"dependencies": {
    "next": "9.4.4",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question