When I try to install react-codemirror2 it gave an error and doesn't install in my app (my react version is #17.0.2) Why it doesn't install?
Error list in below 👇🏻
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: code-editor-with-react#0.1.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#">=15.5 <=16.x" from react-codemirror2#7.2.1
npm ERR! node_modules/react-codemirror2
npm ERR! react-codemirror2#"*" 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 C:\Users\Mahdi\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
If anyone else has the same problem like me
He/she can just install "react-codemirror2-react-17" instead "react-codemirror2"
It worked for me.
I faced a similar error message.
Try using npm install react-codemirror2 --legacy-peer-deps
After writing:
"engines": {
"node": "14.x"
}
in package.json, react-codemirror2 worked correctly
Related
I'm having really difficult time resolving dependency conflicts when installing and updating npm packages. The console error is as below. I tried installing legacy deps and reinstalling some modules but none seems working.
Could someone help me how to resolve this conflicts ? What to delete/reinstall/update ?
edit: using sveltekit latest version
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #sveltejs/kit#1.0.0-next.454
npm ERR! Found: vite#2.9.15
npm ERR! node_modules/vite
npm ERR! dev vite#"^2.9.15" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite#"^3.1.0-beta.1" from #sveltejs/kit#1.0.0-next.454
npm ERR! node_modules/#sveltejs/kit
npm ERR! dev #sveltejs/kit#"next" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vite#3.1.0-beta.1
npm ERR! node_modules/vite
npm ERR! peer vite#"^3.1.0-beta.1" from #sveltejs/kit#1.0.0-next.454
npm ERR! node_modules/#sveltejs/kit
npm ERR! dev #sveltejs/kit#"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.
npm ERR!
npm ERR! See /Users/krystian/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/krystian/.npm/_logs/2022-08-30T19_09_07_228Z-debug-0.log
The error message indicates you have vite#2.9.15 installed, but #sveltejs/kit#1.0.0-next.454 expects vite#^3.1.0-beta.1.
A quick fix is to install that version of vite with:
npm i -D vite#^3.1.0-beta.1
I am currently working on a react-native project and want to install native-base library but getting the following error ...
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: demo#0.0.1
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR! peer react#"*" from native-base#3.0.6
npm ERR! node_modules/native-base
npm ERR! native-base#"3.0.6" from the root project
npm ERR! 1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native#0.64.2
npm ERR! node_modules/react-native
PS C:\Users\Bishal Ghosh\Desktop\React-Native\demo> npm install native-base --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: demo#0.0.1
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR! peer react#"*" from native-base#3.0.6
npm ERR! node_modules/native-base
npm ERR! native-base#"*" from the root project
npm ERR! 1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native#0.64.2
npm ERR! node_modules/react-native
npm ERR! react-native#"^0.64.2" from the root project
npm ERR! peer react-native#"*" from native-base#3.0.6
npm ERR! node_modules/native-base
npm ERR! native-base#"*" 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 C:\Users\Bishal Ghosh\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bishal Ghosh\AppData\Local\npm-cache\_logs\2021-08-02T06_48_53_257Z-debug.log
I tried solving the issue by removing my node_modules folder but didn't work. Then, I installed using --legacy-peer-deps, it gets installed. So, now I would like to know will it run in long-run if I install my dependencies using those flags??
I don't think it would harm but I can't tell you that as a fact.
What I can do is to tell how I solved similar issue I had.
I assume that you are using npm version 7.X.X (you can check it with npm --version
If that indeed the case this error will be shown almost on every dependency you'll try to install so what I did was to downgrade back to npm 6.
To do that all you need to do is run the following command in your command line:
npm install -g npm#6.14.13
I am trying to install react-paystack and I am getting this error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myfapp#0.1.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.0 || ^16.0.0" from react-paystack#3.0.4
npm ERR! node_modules/react-paystack
npm ERR! react-paystack#"*" 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 C:\Users\Jeffrey Matthew\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Jeffrey Matthew\AppData\Local\npm-cache\_logs\2021-08-12T05_04_04_535Z-debug.log
Any solutions, please?
I think the reason is clear. Installed react version is 17.0.2 where as react-paystack 3.0.4 requires older version (16.x).
As current react-paystack only works on react 16.x, I think the only way is to create react project with 16.x version and try again.
You might have another node_modules folder or package.json file in a parent folder.
So I have a project available on stackblitz that I want to use offline for my own purposes. for reference, here is the link to what I want to use- https://stackblitz.com/edit/nvs-angular-search-dropdown-istnzp. So, I tried to download the code and planned to run it using npm install and ng serve. but I am getting lots of errors on running npm install saying like this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: angular#0.0.0
npm ERR! Found: #angular/compiler#12.0.3
npm ERR! node_modules/#angular/compiler
npm ERR! #angular/compiler#"^12.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/compiler#"7.0.4" from #angular/compiler-cli#7.0.4
npm ERR! node_modules/#angular/compiler-cli
npm ERR! dev #angular/compiler-cli#"~7.0.0" 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 C:\Users\cnaag\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\cnaag\AppData\Local\npm-cache\_logs\2021-06-06T10_39_43_617Z-debug.log
Any help in this regard would be amazing!
Instead of NPM, install Yarn on your machine and run yarn install
npm i typewriter-effect
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: typetest#0.1.0
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"16.x" from typewriter-effect#2.17.0
npm ERR! node_modules/typewriter-effect
npm ERR! typewriter-effect#"*" 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 C:\Users\USER\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Local\npm-cache\_logs\2021-05-03T18_40_11_049Z-debug.log
Just add the flag --force and then run. typewriter-effect is just using an older version of react. Don't worry about the version conflict just run, for me it worked without any issue.
You have to restart your Terminal to continue installing otherwise it will give error...
I encountered this error today morning... So looking forward you can also solve this