0

Currently, my application is in Angular 8, and I am using @angular-material-extensions/google-maps-autocomplete library in my project.

While updating my project from Angular 8.1.0 to 9.0, I update this dependency using below command:

ng update @angular-material-extensions/google-maps-autocomplete --allowDirty --force

while running ng serve command, I am getting below issue:

ERROR in The target entry-point "@angular-material-extensions/google-maps-autocomplete" has missing dependencies: - @angular/flex-layout

The manual installation of flex-layout package solves the issue.

Is manual installation is a good way? Shouldn't it be handled automatically by updating angular-material-extensions/google-maps-autocomplete library?

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

The log given by the failure

    $ ng serve

    ERROR in The target entry-point "@angular-material-extensions/google-maps-autocomplete" has missing dependencies:

@angular/flex-layout
Rahul Upadhyay
  • 128
  • 2
  • 10
  • As I read here https://flaviocopes.com/npm-peer-dependencies/, we need to install peer dependency manually by keeping the dependency as a part of the project's package.json – Rahul Upadhyay Jun 21 '20 at 13:25

2 Answers2

1

try this instead npm i @angular/flex-layout@9.0.0-beta.31 it fixed this issue for me

0

If you perform update using ng update it won't be able to update all of the dependency packages to the latest versions.

Instead of ng update if you use ng update --all it take care of updating all peer dependency and their dependency as well

sunilbaba
  • 441
  • 2
  • 9
  • Thanks for the suggestion! yes, you are right about 'ng update --all', but for my project, I was facing some other issue through that approach. So followed the approach as suggested here: https://update.angular.io/ – Rahul Upadhyay Jun 18 '20 at 10:23
  • There is no issues in installing those dependencies manually in your use case. – sunilbaba Jun 18 '20 at 10:45