如何在可视化应用程序中删除依赖于同一依赖项的多个版本的警告?



如 https://developer.here.com/olp/documentation/data-visualization-library/dev_guide/pages/install-generator.html 中所述创建可视化应用程序时,收到"requires a peer of three@^0.104.0 but none is installed."

.但是在package.json,我们已经依赖于three但在版本0.99.0. 还有警告中提到的源版本,例如@here/harp-lines@0.2.3,在package.json中处于较低版本,即"@here/harp-lines": "^0.2.1"当我运行 Web 服务器时,我确实获得了底图和用户授权表单。但是,我无法在可能的"加载文件"(因为页面片段为空白)小部件中看到任何内容。

提供的步骤:https://developer.here.com/olp/documentation/data-visualization-library/dev_guide/pages/install-generator.html 这将生成应用程序,但带有警告。 在创建项目时选择"从 geojson 文件">(选项 5)。 在运行应用程序,然后填写身份验证信息时,它会显示底图。然而,别无他法。

以下是在控制台上看到的警告:

npm WARN @here/harp-lines@0.2.3 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.
npm WARN @here/harp-datasource-protocol@0.3.3 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.
npm WARN @here/harp-mapview@0.8.3 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.
npm WARN @here/harp-map-controls@0.2.3 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.
npm WARN @here/harp-materials@0.2.3 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.
npm WARN @here/harp-text-canvas@0.2.3 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.
npm WARN @here/harp-geometry@0.1.2 requires a peer of three@^0.104.0 but none is installed. You must install peer dependencies yourself.

我们使用 harp.gl 库存在问题。他们在不增加次要版本的情况下发布了 API 中断性更改。它将随着 OLP 2.5 的发布而修复。

如果您不想等待 2.5 版本发布,请执行以下操作:

  • 运行生成器,以便生成应用程序
  • 删除生成的应用程序路径下的node_modules文件夹,以清理已安装依赖项的列表
  • 在任何文本编辑器或 IDE 中打开 package.json 文件
  • 删除从前缀"@here/harp-"启动的所有依赖项以及特定模块的版本号前的"^"符号:数据存储-API、Hype 和 OAuth-请求程序。通过这样做,我们将 NPM 指向使用在 package.json 中指定的确切版本
  • 将新的依赖项"@here/harp-text-canvas":"0.2.1"添加到包中.json
  • 然后运行"npm install"以根据您对 package.json 所做的更改安装依赖项
  • 然后运行"npm start">

最新更新