Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with React ^17 #86

Open
riceball1 opened this issue Dec 20, 2021 · 14 comments
Open

Not compatible with React ^17 #86

riceball1 opened this issue Dec 20, 2021 · 14 comments

Comments

@riceball1
Copy link

Tried this with react ^17.0.2 installed, but got the following error when trying to npm i react-textfit

Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0" from [email protected]
npm ERR! node_modules/react-textfit
npm ERR!   react-textfit@"*" from the root project
@abhishek0010
Copy link

Should work with --force

@Jennydunix
Copy link

@abhishek0010 thank you! it worked for me

@pberlia0202
Copy link

pberlia0202 commented Mar 16, 2023

can you tell where to add --force in the command npm i react-textfit

@pberlia0202
Copy link

i m getting the same problem

@Jennydunix
Copy link

@pberlia0202 here's what I did

npm i react-textfit --force

@pberlia0202
Copy link

PS C:\Users\pberl\OneDrive\Desktop\my-calc> npm i react-textfit --force
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN peer react@"^18.0.0" from @testing-library/[email protected]
npm WARN node_modules/@testing-library/react
npm WARN @testing-library/react@"^13.4.0" from the root project
npm WARN 2 more (react-dom, the root project)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^15.0.0 || ^16.0.0" from [email protected]
npm WARN node_modules/react-textfit
npm WARN react-textfit@"^1.1.1" from the root project
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN peer react@"^15.0.0 || ^16.0.0" from [email protected]
npm WARN node_modules/react-textfit
npm WARN react-textfit@"^1.1.1" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^18.0.0" from @testing-library/[email protected]
npm WARN node_modules/@testing-library/react
npm WARN @testing-library/react@"^13.4.0" from the root project
npm WARN 1 more (the root project)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^15.0.0 || ^16.0.0" from [email protected]
npm WARN node_modules/react-textfit
npm WARN react-textfit@"^1.1.1" from the root project
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^15.0.0 || ^16.0.0" from [email protected]
npm WARN react-textfit@"^1.1.1" from the root project

@pberlia0202
Copy link

This os the problem I m gettinng after using npm i react-textfit --force

@pberlia0202
Copy link

also after using --force, localhost stops working

@Jennydunix
Copy link

Ok let's try again run the command
npm install react-textfit --save
on your terminal

@pberlia0202
Copy link

PS C:\Users\pberl\OneDrive\Desktop\my-app> npm install react-textfit --save
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! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0" from [email protected]
npm ERR! node_modules/react-textfit
npm ERR! react-textfit@"*" 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!
npm ERR! For a full report see:
npm ERR! C:\Users\pberl\AppData\Local\npm-cache_logs\2023-03-16T15_06_56_708Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pberl\AppData\Local\npm-cache_logs\2023-03-16T15_06_56_708Z-debug-0.log

@Jennydunix
Copy link

I just tried it out on my react application and it worked

@QASIMMIRZA-007
Copy link

i was facing this same issue . After research i come to know that npm install react-textfit --save -force works and required module installed other wise you can try npm i react-textfit --save --legacy-peer-deps but my recommendation is npm install react-textfit --save -force.

@jujharsingh2802
Copy link

For me the problem is coming on deployment on vercel

@jujharsingh2802
Copy link

The problem I encountered was not in the app rather in deployement, but the problem was resolved after I downgraded my react version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants