Fix the Angular 9 error "node_modules/@angular/common/common" has no exported member 'ViewportScroller' using Angular9
The error description appears as : "Module ':/ionicapp/node_modules/@ angular/common/common"' has no exported member 'ViewportScroller'." .
This error happens after you installed the missing router in the Ionic app :
npm install @angular/router --save
This error happens after you installed the missing router in the Ionic app :
npm install @angular/router --save
What the error is trying to inform us is, that the versions installed do not comply : the router installed is a different version from the one of the Angular version on your app.
We have to open the PACKAGE.JSON file, and check the versions there :
In this case, version of the @angular/core is 5.2.11, while the @angular/router that was installed, is version 9.1.9 . Of course it wouldn't work. It lacks/requires all kind of methods and properties.
Therefore, remove the router and install it according to the current version on your application:
npm install @angular/router@5.2.11 --save
We have to open the PACKAGE.JSON file, and check the versions there :
In this case, version of the @angular/core is 5.2.11, while the @angular/router that was installed, is version 9.1.9 . Of course it wouldn't work. It lacks/requires all kind of methods and properties.
Therefore, remove the router and install it according to the current version on your application:
npm install @angular/router@5.2.11 --save
Now it looks OK. Compile and keep enjoying !!
That's All!!!
Enjoy Angular.....
by Carmel Schvartzman
כתב: כרמל שוורצמן
by Carmel Schvartzman
כתב: כרמל שוורצמן
Thanks for sharing your ideas and view, this is appreciable.
ReplyDeleteGermany VPS Hosting