react-textfit icon indicating copy to clipboard operation
react-textfit copied to clipboard

Not compatible with React ^17

Open riceball1 opened this issue 3 years ago • 14 comments
trafficstars

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

riceball1 avatar Dec 20 '21 03:12 riceball1

Should work with --force

abhishek0010 avatar Jun 22 '22 17:06 abhishek0010

@abhishek0010 thank you! it worked for me

Jennydunix avatar Oct 10 '22 22:10 Jennydunix

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

pberlia0202 avatar Mar 16 '23 04:03 pberlia0202

i m getting the same problem

pberlia0202 avatar Mar 16 '23 04:03 pberlia0202

@pberlia0202 here's what I did

npm i react-textfit --force

Jennydunix avatar Mar 16 '23 06:03 Jennydunix

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 avatar Mar 16 '23 06:03 pberlia0202

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

pberlia0202 avatar Mar 16 '23 06:03 pberlia0202

also after using --force, localhost stops working

pberlia0202 avatar Mar 16 '23 06:03 pberlia0202

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

Jennydunix avatar Mar 16 '23 15:03 Jennydunix

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

pberlia0202 avatar Mar 16 '23 15:03 pberlia0202

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

Jennydunix avatar Mar 16 '23 15:03 Jennydunix

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.

QASIMMIRZA-007 avatar Mar 07 '24 10:03 QASIMMIRZA-007

For me the problem is coming on deployment on vercel

jujharsingh2802 avatar Jun 29 '24 20:06 jujharsingh2802

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

jujharsingh2802 avatar Jul 09 '24 08:07 jujharsingh2802