malte-wessel/react-textfit

Not compatible with React ^17

riceball1 opened this issue · 14 comments

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 react-textfit@1.1.1
npm ERR! node_modules/react-textfit
npm ERR!   react-textfit@"*" from the root project

Should work with --force

@abhishek0010 thank you! it worked for me

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

i m getting the same problem

@pberlia0202 here's what I did

npm i react-textfit --force

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: react-textfit@1.1.1
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN peer react@"^18.0.0" from @testing-library/react@13.4.0
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 react-textfit@1.1.1
npm WARN node_modules/react-textfit
npm WARN react-textfit@"^1.1.1" from the root project
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^15.0.0 || ^16.0.0" from react-textfit@1.1.1
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: react-textfit@1.1.1
npm WARN Found: react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^18.0.0" from @testing-library/react@13.4.0
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 react-textfit@1.1.1
npm WARN node_modules/react-textfit
npm WARN react-textfit@"^1.1.1" from the root project
npm WARN
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^15.0.0 || ^16.0.0" from react-textfit@1.1.1
npm WARN react-textfit@"^1.1.1" from the root project

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

also after using --force, localhost stops working

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

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: my-app@0.1.0
npm ERR! Found: react@18.2.0
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 react-textfit@1.1.1
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

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

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.