如何在我的AngularJS项目中包含Chart.js?

问题描述 投票:1回答:3

我是AngularJS的新手,目前正在在Ubuntu上构建应用程序。当我尝试使用npm install chart.js安装Chart.js时,它将引发以下错误

npm WARN [email protected] requires a peer of jasmine-core@>=3.5 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/karma/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular/compiler-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
updated 1 package and audited 19058 packages in 9.013s

23 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

此错误是什么意思?

我该如何解决?

除了安装命令,还有其他方法可以将Chart.js包含在我的项目中吗?

javascript angularjs npm chart.js
3个回答
1
投票

您的安装中有0个漏洞。您所说的错误只是WARN表示警告,可以成功安装Chart.js,可以忽略这些警告。您应该会很好。

如果您想摆脱这些警告,因为它说的是You must install peer dependencies yourself.

尝试npm安装jasmine-core@>=3.5


0
投票

npm决定添加一个新命令:npm fund,它将向npm用户提供更多可见性,以了解哪些依赖项正在积极寻找为他们的工作提供资金的方法。

npm install还将在最后显示一条消息,以使用户知道依赖项正在寻找资金,它看起来像这样:

$ npm install
13 packages are looking for funding.
run `npm fund` for details.

运行npm基金将在您的浏览器中打开为该给定软件包列出的URL。

npm资金并不意味着未安装该软件包,您的软件包已成功安装。

please check this for more information


0
投票

您没有收到仅警告的任何错误(您可以忽略它们)。首先,您可以从https://github.com/jtblin/angular-chart.js手动下载但是您已经从npm安装了它们,因此请尝试将其包含在项目中

加载角度模块时,请不要忘记使用angular.module('myModule',['chart.js']);让我们知道您是否能够使用它,祝您好运!

© www.soinside.com 2019 - 2024. All rights reserved.