Upgrade Ionic to latest version

We did big chat. Things which were helpful:

  1. Be sure that you completely delete all previous version with npm uninstall -g ionic or manually from rm -rf /usr/local/lib/node_modules. Don't forget remove symlink too: rm -rf /usr/local/bin/ionic
  2. After completely deletion you should see error: command not found of ionic -v
  3. And now if your npm root -g path is right like /usr/local/lib/node_modules try to install npm install -g ionic@latest. Then you should get correct output of ionic -v

I simple run

$ ionic --version
$ 4.2.1
$ sudo npm i -g ionic@latest 
$ ionic --version
$ 4.8.0

The ionic CLI package has been renamed @ionic/cli https://twitter.com/ionicframework/status/1223268498362851330

So you should uninstall ionic from your global

npm uninstall -g ionic

and add the new package name.

npm install -g @ionic/cli@latest

In case anyone comes here from google.