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

Can't resolve 'chart.js'

Open Legendofire opened this issue 7 years ago • 7 comments

I installed react-chartjs via NPM and when i try and use Pie i get the error Error Can't resolve 'chart.js' in '/home/a7meds3d/Documents/WorkSpace/MERN/CIOChatbot/node_modules/react-chartjs/lib'.

Legendofire avatar Apr 29 '18 19:04 Legendofire

The documentation reads:

"You must also include chart.js and React as dependencies."

Run the following command: npm install --save chart.js

larsdouweschuitema avatar May 02 '18 14:05 larsdouweschuitema

The error message was after I installed chart.js, maybe I installed chartjs not chart.js. Will test it again.

Legendofire avatar May 02 '18 15:05 Legendofire

@larsdouweschuitema This solved my problem. Thanks!

Tom-Gorup avatar Jun 27 '18 21:06 Tom-Gorup

@larsdouweschuitema thank you !

amineb01 avatar Sep 05 '18 11:09 amineb01

Why not add chart-js as an actual dependency in the package.json file?

gion avatar Sep 28 '18 19:09 gion

Please add these in angular.json file "scripts": [ "node_modules/chart.js/dist/Chart.js", "node_modules/hammerjs/hammer.min.js" ],

javaProgrammer44 avatar Oct 24 '18 13:10 javaProgrammer44

Install missing charts dependencies: charts.js & angular2-chartsjs I installed it locally and it worked. Don't forget to import these in your code.

kumarbitthal avatar Jan 10 '19 10:01 kumarbitthal