• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

chart.js설치했는데 경로가 없다고 에러가 나요?

21.01.11 14:37 작성 조회수 161

0

1. chart.js를 설치했을 때 나온 메세지입니다.

npm install chart.js --save

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})    

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})   

+ chart.js@2.9.4

updated 1 package and audited 1465 packages in 8.377s

82 packages are looking for funding

  run `npm fund` for details

found 0 vulnerabilities

제대로 설치된 걸까요?

2.  dist파일에 chart.js가 있던데... 제가 찾아본 예제는 import {Chartfrom 'node_modules/chart.js'; 하라고 해서
했는데 안되고, dist를 붙여도 dist다음에 chart.js를 붙여도 안되네요.

Error: src/app/my-chart/my-chart.component.ts:2:21 - error TS7016: Could not find a declaration file for module 'node_modules/chart.js/dist/Chart.js'. 'C:/MyAngular/front-end/node_modules/chart.js/dist/Chart.js' implicitly has an 'any' type. Try `npm install @types/chart.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'node_modules/chart.js/dist/Chart.js';` 2 import {Chart} from 'node_modules/chart.js/dist/Chart.js';

뭐가 문제일까요?

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!