首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法安装角谷歌地图

无法安装角谷歌地图
EN

Stack Overflow用户
提问于 2022-03-29 17:56:04
回答 1查看 2.4K关注 0票数 0

我无法安装角度谷歌地图到我的Ionic角项目。我试着运行命令npm install @agm/core --save,但是我得到了以下错误:

代码语言:javascript
运行
复制
code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: MyProgram@0.0.1
npm ERR! Found: @angular/common@11.2.14
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~11.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^9.1.0 || ^10.0.0" from @agm/core@3.0.0-beta.0
npm ERR! node_modules/@agm/core
npm ERR!   @agm/core@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

我的package.json使用的是11.2版本.

代码语言:javascript
运行
复制
dependencies": {
    "@angular/animations": "~11.2.0",
    "@angular/cdk": "^11.2.2",
    "@angular/common": "~11.2.0",
    "@angular/core": "~11.2.0",
    "@angular/forms": "~11.2.0",
    "@angular/material": "^11.2.2",
    "@angular/platform-browser": "~11.2.0",
    "@angular/platform-browser-dynamic": "~11.2.0",
    "@angular/router": "~11.2.0",
    "@capacitor/android": "^2.4.6",
    "@capacitor/core": "2.4.6",
    "@ionic-native/core": "^5.31.1",
    "@ionic-native/photo-viewer": "^5.31.1",
    "@ionic/angular": "^5.5.2",
    "capacitor-video-player": "^2.4.5-2",
    "com-sarriaroman-photoviewer": "^1.2.5",
    "cordova-plugin-geolocation": "^4.1.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },

我尝试运行ng update @angular/cli @angular/core,这将导致以下输出:

代码语言:javascript
运行
复制
Node.js version v15.5.1 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/releases/.
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
✔ Package successfully installed.
Node.js version v15.5.1 detected.
The Angular CLI requires a minimum Node.js version of either v12.20, v14.15, or v16.10.

但是,如果我尝试使用NVM将我的节点版本设置为16,ng突然就不作为命令存在了。

EN

回答 1

Stack Overflow用户

发布于 2022-03-29 17:58:35

您有依赖冲突(不正确的和可能中断的依赖关系),因此尝试使用--legacy-peer-deps. (-force)运行该命令。如果它不生效,临时解决方案是使用Node.js的早期版本(降级Node.js版本),因为它有时会导致此类错误发生。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71666735

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档