Upgrade to latest ionic


#1

Hello everyone!

I’m new on Ionic and I am trying to understand how it works around npm and installation packages on my Win10’s notebook, so I did “npm install -g ionic-angular cordova” where doing the npm info version I see for ionic-angular it’s 2.9.0 version… so I downloaded from github latest version of ionic-native 4.6.0, unpacked it in C:\ and I did “npm update ionic-native” but it didn’t nothing… doing “npm list ionic-native” returned me " '–(empty)"…
What I should do to update correctly ionic-native to latest? And a little confirm: having ionic-angular installed is similar to have ionic and angular in separate way?

Thanks
Cheers,
Luigi


#2

Do you mean in a project, correct?

If so, you have to update your package.json file. You could do a npm outdate and look what the desired versions are (or current if you feel bold)

If you mean install en your pc the latest version of Ionic in general then you have to do npm -g install ionic@latest
That will give you the latest version of the ionic cli. You can then start a new project with ionic start


#3

Hello,

thanks distante for your reply so quick…

Anyway I did precisely:

  1. installed node.js to have npm

  2. npm -g install ionic-angular cordova --> that’s installed under %appdata%\npm

  3. npm info ionic version --> 3.9.2

  4. npm info ionic-native version --> 2.9.0

  5. downloaded from https://github.com/ionic-team/ionic-native/releases latest ionic-native 4.6.0 sources

  6. unpacked that v4.6.0.zip then did “npm update ionic-native” which it supposed to put those files under modules in ionic-angular package

  7. npm info ionic-native version --> still 2.9.0

at this point I missed something when it supposed to return me 4.6.0 at info version request…

And is ionic-angular package similar though to have ionic and angular separated?

Thanks!

Cheers,

Luigi


#4

This is a common problem in the npm ecosystem, but “ionic-native” is obsolete. Do not install it. There is also no need to deal with github directly here. Simply follow these instructions.


#5

Hello rapropos, thanks for your reply quick,

I thought ionic is just about modules/packages that could be updated to latest… I guess doing “npm install -g ionic@latest”, at the page link you gave me, means stable release indeed doing separate install is just to update to current release with current functions…

And I am looking for ionic-native because I was thinking to create a simple iOS/Android app which have BLE package.

Lemme guess maybe adding ionic-native in the app instead of ionic installation, will add latest ionic-native , right?

Thanks,

Cheers

Luigi


#6
  1. “npm install -g ionic@latest” to get the ionic cli and utils,
  2. ionic start to get a basic project structure in which you starts your app.
  3. Install plugins and dependencies ( like the ones in the link rapropos posted)

#7

My usual method to upgrade ionic

1.) Find ionic 3 release latest package.json file (U can find it by either checking the changelog or just start a new project ionic start myApp and grab their package.json file

2.) Delete node modules

3.) run npm install

4.) ionic info command just to double confirm

Side note, ionic native is a separate package from ionic-angular. Updating ionic version doesnt automatically update ionic native


#8

Just thinking about “do not install the ionic-native”…but wouldn’t just developing with ionic-native be the way to make app for both Android and iOS?..


#9

Until Ionic capacitor come out, we are stuck at ionic native plugins …


#10

wait…ignore my rambling

On the later release of Ionic Native…you start by installing @ionic-native/core FIRST…then only you install other ionic native plugins.

npm install @ionic-native/core --save

Whereas on the older release, you do this

npm install @ionic-native

Make sure your package.json has the dependency of @ionic-native/core


#11

Hello all…

I’ll try then as you said… just one question since I’m trying to compare… what’s the difference between having ionic-angular (together) or having ionic and angular as separate modules?


#12

“ionic-angular” is the name of the package that provides the Ionic framework classes to an app. What you probably think of as the “ionic” package is really ionic-cli, which provides the build-time environment and is not bundled as part of your app.


#13

If I create project in a directory inside a USB key , can I work on it also from different places like from a laptop and from a workstation separately?..


#14

i will not advise that

the node module folder in ionic project is obscenely hard to transfer…once i made an accident mistake of copy and pasting a sample ionic project and it took over an hour.

Besides, using git to manage your project is simply better if you want to work the same project across different devices