Best practice when upgrading MDB


Topic: Best practice when upgrading MDB

itay pro asked 5 years ago

Whenever a new version of MDB is released I struggle to install it

Can you please point me to a guide that specifies what should I do with respect to:

package.json, package-lock.json, npm and ng commands, etc.

Thanks


Bartosz Termena staff commented 5 years ago

Hi!

Check out our migration guide: https://mdbootstrap.com/docs/angular/getting-started/migration/#mdb8

Hope it helps!

Best Regards, Bartosz.


itay pro answered 5 years ago

The migration guide is for extreme cases.

I am more interested with minor upgrades, e.g. from 8.5 to 8.6


Arkadiusz Idzikowski staff answered 5 years ago

We explained that in the update instructions: https://mdbootstrap.com/docs/angular/getting-started/update/

You can find there examples for various versions and use cases. Basically if you install MDB Angular from .tgz archive, you need to replace the archive with new one, update its version in the package.json file and reinstall the dependencies. If you install our library from gitlab server, then you just need to reinstall the dependencies and newest version will be downloaded automatically.

In installation from gitlab you can also specify exact version that should be downloaded, for example for 8.6.0:

npm install git+https://oauth2:YOUR_TOKEN@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git#8.6.0 --save

itay pro answered 5 years ago

And if I use gitlab without specific version, what should I do ?


Arkadiusz Idzikowski staff answered 5 years ago

In this case if you reinstall your dependecies with npm install command, the newest version of MDB Angular will be downloaded automatically from the gitlab server. There is an example in our update instructions (MDB Pro version, 'gitlab' tab).


itay pro answered 5 years ago

It says: "Remove node_modules directory ..."

Do I have to remove it, as it has its consequences with other libraries ?


Arkadiusz Idzikowski staff commented 5 years ago

You can update only single package with npm install / npm update, for example:

npm update ng-uikit-pro-standard / npm install ng-uikit-pro-standard

With this command you can update only mdb angular pro package.

We recommended to do full reinstall in the guide because there were many problems with cache. We will probably update it slightly in the near future and add more detailed information about updates.

If you don't want to update any other libraries, it might be good idea to specify exact versions in the package.json, so you don't overwrite them accidentally.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.6.0
  • Device: NA
  • Browser: NA
  • OS: NA
  • Provided sample code: No
  • Provided link: No