rrag / react-stockcharts

Highly customizable stock charts with ReactJS and d3
http://rrag.github.io/react-stockcharts
MIT License
3.84k stars 956 forks source link

Dependency error during installation #825

Open hsafari opened 10 months ago

hsafari commented 10 months ago

Hi How do I fix it please? I'm not expert in Java and NPM

ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: stc@1.0.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-stockcharts@0.7.8 npm ERR! node_modules/react-stockcharts npm ERR! react-stockcharts@"^0.7.8" from the root project npm ERR!

gnaneshwar718 commented 10 months ago

hi i will fix this error ,so anyone who comes this across later
i am already working on it i will send pr when it is done

hsafari commented 10 months ago

Thank you very much Ganeshwar.

gnaneshwar718 commented 10 months ago

there was no problem, the react scrips version is outdated you can fix it by running npm install react@16.0.0

hsafari commented 10 months ago

It seems too complected for me. multiple errors again. I tried to remove/uninstall all but slit the same error. I wish the package had a complete dependency/steps document for installation that everyone can check one by one and then run the react-stock-chart.

..:~$ npm install react@16.0.0 npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: stc@1.0.0 npm WARN Found: react@16.0.0 npm WARN node_modules/react npm WARN react@"16.0.0" from the root project npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^18.2.0" from react-dom@18.2.0 npm WARN node_modules/react-dom npm WARN react-dom@"^18.2.0" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: stc@1.0.0 npm WARN Found: react@16.0.0 npm WARN node_modules/react npm WARN react@"16.0.0" from the root project npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^15.0.0" from react-stockcharts@0.6.1 npm WARN node_modules/react-stockcharts npm WARN react-stockcharts@"^0.6.1" from the root project npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: react-stockcharts@0.6.1 npm ERR! Found: react-dom@18.2.0 npm ERR! node_modules/react-dom npm ERR! react-dom@"^18.2.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-dom@"^15.0.0" from react-stockcharts@0.6.1 npm ERR! node_modules/react-stockcharts npm ERR! react-stockcharts@"^0.6.1" from the root project npm ERR! npm ERR! Conflicting peer dependency: react-dom@15.7.0 npm ERR! node_modules/react-dom npm ERR! peer react-dom@"^15.0.0" from react-stockcharts@0.6.1 npm ERR! node_modules/react-stockcharts npm ERR! react-stockcharts@"^0.6.1" 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!

gnaneshwar718 commented 9 months ago

I will check it out once

dcnc336 commented 9 months ago

There was same issues for me I think react-stockcharts library isn't enable for over react version +17 Please downgrade react version with 16

Here is way to downgrade from 18 to 16 update react libraries version with 16

"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-scripts": "5.0.1",
"@testing-library/react": "^12.0.0",

delete node_modules folder and run npm install

and can install react-stockcharts library, it worked for me

hsafari commented 9 months ago

Thank you dcnc336. I'll try to do the same as you said.