当前,我的应用程序在Angular 8中,并且我在项目中使用 @ angular-material-extensions / google-maps-autocomplete 库。
在将项目从Angular 8.1.0更新到9.0时,我使用以下命令更新了此依赖项:
ng update @angular-material-extensions/google-maps-autocomplete --allowDirty --force
在运行 ng serve 命令时,出现以下问题:
目标入口点“ @ angular-material-extensions / google-maps-autocomplete”中的错误缺少相关性:-@ angular / flex-layout
手动安装flex-layout软件包可以解决此问题。
手动安装是个好方法吗?是否应该通过更新angular-material-extensions / google-maps-autocomplete库来自动处理它?</ p>
OS and Version?
Windows 10
Versions
Angular CLI: 9.1.8
Node: 12.18.0
OS: win32 x64
Angular: 9.1.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
@angular-devkit/architect 0.801.3
@angular-devkit/build-angular 0.901.8
@angular-devkit/build-optimizer 0.901.8
@angular-devkit/build-webpack 0.901.8
@angular-devkit/core 9.1.8
@angular-devkit/schematics 9.1.8
@angular/cdk 9.2.4
@angular/cli 9.1.8
@angular/flex-layout 9.0.0-beta.31
@angular/material 9.2.4
@ngtools/webpack 9.1.8
@schematics/angular 9.1.8
@schematics/update 0.901.8
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
Steps to reproduce the issue
ng update @angular/core @angular/cli
ng update @angular/material --allowDirty
ng update @angular-material-extensions/google-maps-autocomplete --allowDirty --force
ng serve
失败给出的日志
$ ng serve
ERROR in The target entry-point "@angular-material-extensions/google-maps-autocomplete" has missing dependencies:
@angular/flex-layout
答案 0 :(得分:1)
试试这个,而不是npm i @ angular / flex-layout @ 9.0.0-beta.31 它为我解决了这个问题
答案 1 :(得分:0)
如果使用ng update执行更新,它将无法将所有依赖项软件包更新到最新版本。
如果您使用ng update --all
而不是ng update,它会同时更新所有对等项的依赖关系以及它们的依赖关系