Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

616
Visualizações
Module not found: Error: Can't resolve 'chart.js' in /node_modules/ng2-charts/fesm2015'

I am encountering the error:

ERROR in ./node_modules/ng2-charts/fesm2015/ng2-charts.js

Module not found: Error: Can't resolve 'chart.js' in /node_modules/ng2-charts/fesm2015'

I did "npm install --save ng2-charts". Could you help me to understand why this error is thrown?

My package.json

"dependencies": {
"@angular/animations": "~8.2.9",
"@angular/common": "~8.2.9",
"@angular/compiler": "~8.2.9",
"@angular/core": "~8.2.9",
"@angular/fire": "^5.2.3",
"@angular/forms": "~8.2.9",
"@angular/platform-browser": "~8.2.9",
"@angular/platform-browser-dynamic": "~8.2.9",
"@angular/router": "~8.2.9",
"@ngrx/store": "^8.6.0",
"@ngrx/store-devtools": "^8.6.0",
"bootstrap": "^4.4.1",
"firebase": "^7.6.0",
"ng2-charts": "^2.2.3",
"rxjs": "~6.4.0",
"sweetalert2": "^9.5.3",
"tslib": "^1.10.0",
"zone.js": "~0.9.1" }

"devDependencies": {
"@angular-devkit/build-angular": "^0.803.21",
"@angular/cli": "~8.3.8",
"@angular/compiler-cli": "~8.2.9",
"@angular/language-service": "~8.2.9",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3" }

Error in broswer

enter image description here

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

ng2-charts is just an angular wrapper for Chart.js library. Hence the latter also needs to be installed separately.

npm install --save ng2-charts

npm install --save chart.js

over 4 years ago · Santiago Trujillo Relatório

0

Try installing chartjs higher version, For me an older version was installed Try "npm install chartjs@3.7.1"

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda