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

标签 here-olp harp.gl

在创建可视化应用程序时,如 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 服务器时,我确实获得了 basemap 和 userAuthorize 表单。但是,我在可能是“加载文件”(因为页面片段是空白的)小部件中看不到任何内容。

提供的步骤:https://developer.here.com/olp/documentation/data-visualization-library/dev_guide/pages/install-generator.html 这会生成应用程序,但会出现警告。 创建项目时选择“来自 geojson 文件”(选项 5)。 在运行应用程序,然后填写身份验证信息时,它会显示 basemap 。然而,除此之外别无他法。

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

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-”开始的依赖项和那些特定模块的版本号前的“^”符号:datastore-api、hype 和 oauth-requester。通过这样做,我们指向 NPM 使用 package.json 中指定的确切版本
  • 添加新的依赖 "@here/harp-text-canvas": "0.2.1", 到 package.json
  • 然后运行“npm install”根据你对package.json所做的修改安装依赖
  • 然后运行“npm start”

关于here-olp - 如何删除依赖于相同依赖项的多个版本的可视化应用程序中的警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56632643/

相关文章:

java - OLP CLI 错误 : java. 基础未将 sun.security.util 导出到 JDK 16 下的未命名模块

here-olp - 如何在本地运行 HERE 开放位置平台 SDK 的示例?

here-olp - 通过 HERE OLP 数据可视化库在自定义数据中使用 64 位整数

javascript - 使用 harp.gl 从 geojson 画一条线