Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update angular material

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
like image 910
Kram_ Avatar asked Nov 30 '17 11:11

Kram_


People also ask

What is latest version of Angular material?

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.


4 Answers

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

like image 70
K. Waite Avatar answered Oct 16 '22 10:10

K. Waite


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.

like image 45
Debiprasad Avatar answered Oct 16 '22 09:10

Debiprasad


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
like image 10
Dipendra Gurung Avatar answered Oct 16 '22 08:10

Dipendra Gurung


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

like image 4
Jacopo Sciampi Avatar answered Oct 16 '22 08:10

Jacopo Sciampi