react-native-svg-charts icon indicating copy to clipboard operation
react-native-svg-charts copied to clipboard

[Feature] Update react-native-svg dependency version

Open hmm210197 opened this issue 4 years ago • 15 comments

Description of feature

As title, it is necessary to update this dependency. Because my project install the newest version of react native svg and react native svg charts not working.

hmm210197 avatar Mar 10 '21 07:03 hmm210197

Got the same issue! Please update the react-native-svg version. It should be super easy i guess. :)

hraschan avatar Aug 27 '21 14:08 hraschan

After updating to the latest version of react-native-svg (12.1.1), npm doesn't allow me to install react-native-svg-charts. npm install react-native-svg-charts will give me the following error:

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-native-svg npm ERR! react-native-svg@"^12.1.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-native-svg@"^6.2.1||^7.0.3" from [email protected] npm ERR! node_modules/react-native-svg-charts npm ERR! react-native-svg-charts@"*" 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 \npm-cache\eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! \npm-cache_logs\2021-11-19T12_58_50_303Z-debug.log

Is there a way to fix this dependency conflict?

UPDATE: I first uninstalled react-native-svg with npm uninstall react-native-svg and reinstalled it with npm i [email protected] to match the required version. This solved the dependency conflict.

mauritsbecks avatar Nov 19 '21 13:11 mauritsbecks

I'm also having this issue with react-native-svg 12.1.1 and react-native-svg-charts 5.4 at this point in time (January 2022). Strange thing is, I installed these two modules late in 2020 for a project back then and it didn't give me problems. That app is still working fine. But trying to install these modules now is giving me the same error as @mauritsbecks .

Any updates or insights?

EDIT: I should mention that both my apps are on Expo 42

UVStudio avatar Jan 12 '22 20:01 UVStudio

@UVStudio my solution was to first uninstall the latest version of react-native-svg with npm uninstall react-native-svg. Subsequently reinstalling react-native-svg, version 7.0.3, with npm i [email protected] to match the required version. This solved the dependency conflict. Good luck.

mauritsbecks avatar Jan 12 '22 21:01 mauritsbecks

@mauritsbecks Thanks for the reply. I should've also mentioned that the react-native-svg 7.0.3 solution didn't work for me. Got the same imageSourceProp error as the last comment in this thread: https://github.com/JesperLekland/react-native-svg-charts/issues/548

EDIT: Trying to install expo-chart-kit is giving me the same error: peer react-native-svg@"^6.4.1" from [email protected] Also, tried installing expo-chart-kit in my old project from 2020 is also giving me the same error.

EDIT TWO: npm i react-native-svg-charts --legacy-peer-deps seems to be working.

UVStudio avatar Jan 12 '22 21:01 UVStudio

I've spent a few hours today going around in circles figuring this out. I am unsure why but using npm to install react-native-svg-charts will throw the dependancy tree error if you're using newer versions of react-native-svg (we were using v12) however yarn does not throw a dependancy error. So yarn add react-native-svg-charts will install react-native-svg-charts regardless of react-native-svg version (idk if yarn just ignores dependancy errors or what). It seems, although it throws a dependancy error, react-native-svg-charts (in my use of it) with react-native-svg v12.1.1 does not break. It still functions fine. So theoretically using the --legacy-peer-deps or --force flags on your npm install of react-native-svg-charts will still install everything and it will be in working order. Alternatively install react-native-svg-charts module using yarn.

Daniel528 avatar Jan 14 '22 06:01 Daniel528

Thank you @Daniel528. I had to eject out of expo for some other reason and this issue was causing me trouble ejecting. I had to remove both react-native-svg and react-native-svg-charts modules first before I managed to successfully eject. Finally got a chance to come back to this thread and your tip got my app working. I get the same warning message as you did but like you said, it still works.

UVStudio avatar Jan 27 '22 01:01 UVStudio

Same problem here. Off course we can use [email protected] but it outdated a bit and unsupport few needed features on my project. So I need one of newer versions of RN SVG. Currently I use 12.1.0 and have same troubles with installing svg-charts as described above. Do anyone familiar with svg-charts can look into and update this dependency?

yahacom avatar Feb 15 '22 13:02 yahacom

What if we change this line https://github.com/JesperLekland/react-native-svg-charts/blob/d840ebe34ca11a9132c84a58e0614fccd773e92e/package.json#L60 to the latest version of the svg? because this is the peerDependancy line which is throwing error.

anwersolangi avatar Mar 18 '22 15:03 anwersolangi

a temporary solution is to install using:

npm install --save react-native-svg-charts --force

again, its temporary and may have issues but its working for me until this library gets updated

MobileMon avatar Dec 14 '22 18:12 MobileMon

a temporary solution is to install using:

npm install --save react-native-svg-charts --force

again, its temporary and may have issues but its working for me until this library gets updated

This working for me too. But, when build APK, the problem return. Just work in emulator

LucasPereiira avatar Dec 30 '22 23:12 LucasPereiira

Using force / legacy-peer-deps was causing issues on subsequent installs, but I was able to fix this permanently by moving react-native-svg from dependencies to overrides in package.json

  "overrides": {
    "react-native-svg": "13.8.0"
  },

If you're using yarn the equivalent field is resolutions

mjewell avatar Mar 18 '23 21:03 mjewell

any update here for this issue?

CMLCNL avatar Apr 24 '23 12:04 CMLCNL

Don't think you'll get an update @CMLCNL, there has been no maintenance in 4 years.

dan-scrumsdotcom avatar Nov 22 '23 12:11 dan-scrumsdotcom

After updating to the latest version of react-native-svg (12.1.1), npm doesn't allow me to install react-native-svg-charts. npm install react-native-svg-charts will give me the following error:

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-native-svg npm ERR! react-native-svg@"^12.1.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-native-svg@"^6.2.1||^7.0.3" from [email protected] npm ERR! node_modules/react-native-svg-charts npm ERR! react-native-svg-charts@"*" 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 \npm-cache\eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! \npm-cache_logs\2021-11-19T12_58_50_303Z-debug.log

Is there a way to fix this dependency conflict?

UPDATE: I first uninstalled react-native-svg with npm uninstall react-native-svg and reinstalled it with npm i [email protected] to match the required version. This solved the dependency conflict.

Try using react-native-svg 12.3.0 and react-native-svg-charts 5.4.0

The older versions don't work

talbertherndon avatar Jan 24 '24 20:01 talbertherndon