What is the best way to update angular material in a project to latest version [email protected]
?
I tried:
npm install --save @angular/material @angular/cdk
Angular Material Version 5.2.2 This is the last version of material that we can see on the angular material official website, you can start using this one if you want to. It has come up with a very basic component.
You'll want to use the npm update command. An example would look like this.
npm update @angular/material @angular/cdk
This will install the latest stable version. If you would like to target a specific version, you would have to specify it by adding the version to the end after an @ symbol.
Additionally, you can check for outdated packages with
npm outdated
Here's the documentation on npm update.
https://docs.npmjs.com/cli/update
Use the following command:
ng update @angular/material
Note: I recently used this command to upgrade from version 8 to version 9. I have not tested it for older versions. Works fine for all versions after version 9.
The following step helped me to update material theme from v9 to v10.
First removed the old package
npm remove @angular/material @angular/cdk
Then installed the latest package
npm add @angular/material @angular/cdk
Way 1
Have you try with a simple npm i @angular/material
? As reported at npmjs he will fetch the latest version.
Way 2
delete the file package-lock.json
and in your package.json
check that you are up to date with the latest angular material, after that simply do an npm i
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With