Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2: How to update Ionic library for an existing project?

Can't find any info on Ionic 2 website. For example, a project is created with Ionic library 2.0.1. How do I update it to Ionic library 2.1.0? What is the standard procedure? ionic lib update is deprecated.

like image 660
Shawn Avatar asked Mar 04 '17 02:03

Shawn


People also ask

Can I add ionic to existing Angular project?

For adding Ionic to an already existing Angular project, use the Angular CLI's ng add feature. This will add the necessary imports to the @ionic/angular package as well as add the styles needed.

How do you find the ionic version of a project?

Get the installed version by running ionic --version . Make sure the latest Node LTS is installed. See Node & npm environment setup.


2 Answers

If you want to update your CLI, you need to run:

npm install -g ionic@latest

For updating your project, open your package.json and update the version of ionic-angular entry and any other dependencies that need to be updated. Reference to a package.json is here which is the one that is downloaded when you start a new project.

Then delete your projects node_modules and run:

npm install in your project directory.

like image 117
Suraj Rao Avatar answered Oct 13 '22 14:10

Suraj Rao


You can also go to your project directory and type:

  1. npm install ionic-angular@latest --save
  2. npm install @ionic/app-scripts@latest --save-dev

In my case, npm install -g ionic@latest installed globally the latest ionic but it didn't update the ionic version of my project. Only the above solution worked.

  • PS 1: I'm using ionic 3
  • PS 2: Delete the project's folder node_modules, in case of errors
like image 25
Realdinho Avatar answered Oct 13 '22 14:10

Realdinho