Failed to compile ./node_modules/chart.js/Chart.js
After making : npm install react-chartjs-2 chart.js --save and trying using the library this is the result that appears : Failed to compile ./node_modules/chart.js/Chart.js Module build failed: Error: ENOENT: no such file or directory
Chart.js is a peer dependency. Please confirm that you have it installed as well
I have installed char.js but it is lookin for ./node_modules/chart.js/Chart.js and doesn’t found it.
Enviado desde Correohttps://go.microsoft.com/fwlink/?LinkId=550986 para Windows 10
De: Jeremy Ayerst [email protected] Enviado: Thursday, January 4, 2018 4:56:43 PM Para: jerairrest/react-chartjs-2 Cc: Robin Hurtado Abadia; Author Asunto: Re: [jerairrest/react-chartjs-2] Failed to compile ./node_modules/chart.js/Chart.js (#233)
Chart.js is a peer dependency. Please confirm that you have it installed as well
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jerairrest/react-chartjs-2/issues/233#issuecomment-355410417, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AScVIHlx749yd1ou8xTzJbDNn-Ay1RJIks5tHUkbgaJpZM4RTwBn.
Possible root cause: #237
I have the same problem. My project is build using create-react-app, and I have react-chartjs-2 and chart.js installed.
any update on this issue ?
Same problem here.
Same problem, anyone here can resolve? (angular7+win10+visualcode+chart (https://valor-software.com/ng2-charts/))
Guys,
The issue seems to be the path is wrong, Kindly go and check inside your node_modules folder before refer the same.
It works fine for me by adding below in to angular.json
"scripts": ["./node_modules/chart.js/dist/chart.js"],
Note: The lateset version of ng2-charts being served from dist folder not from src forlder!
I experienced the same issue, and solved it with the following
- Renaming "node_modules" to "node_modules_old"
- Run npm install
- Run npm install --save react
- Run npm install --chart.js
- Run npm install --react-chartjs-2
Closing for now. Please supply a sandbox or code example with the latest versions of both libraries. If the problem persists, feel free to open a new issue.
Found the issue:
The documentation uses a captical C in Chart.js, when it should be chart.js
change in angular.json file:
node_modules/chart.js/Chart.js => node_modules/chart.js/chart.js
Here is the typo in the documentation: https://primefaces.org/primeng/showcase/#/chart
It is in the section of how to add the reference to angular.json file