Ionic CLI v3 released!

Uh, seems the Ionic CLI v3 Release Candidates were successful:


Awesome.

#New Readme
is here: https://github.com/driftyco/ionic-cli

That’s the gist of it:

We have rewritten the CLI from the ground up. Our main focus was to:

  • Decrease the amount of time to the first start execution
  • Improve the responsiveness of every CLI command
  • Make the architecture flexible for future platform support (PWA, electron, etc.)
  • Provide better help, more guidance, and more feedback when executing commands.

In doing so we decided to take a new approach to the CLI’s structure. The base CLI installation now ships with global commands that are common to all Ionic apps.

#Upgrade Instructions

for current Ionic projects are here:
https://github.com/driftyco/ionic-cli#existing-project

and here for Ionic v1 projects:
https://github.com/driftyco/ionic-cli#existing-project-1

Changelog

is here:
https://github.com/driftyco/ionic-cli/blob/master/CHANGELOG.md

Most relevant change is probably this one:

Cordova commands have been namespaced (ionic --> ionic cordova) to allow for future platform support and to reduce clutter. Cordova functionality has been moved into a CLI plugin, which is installed by default with new Ionic projects and can be installed in existing Ionic projects with npm i --save @ionic/cli-plugin-cordova.

New official CLI documentation

lives here http://ionicframework.com/docs/cli/ and is so much better than the old one.


My testing of the last few RCs was great, so I will upgrade soon. Not much that can go wrong now, and just the speedup is worth it.

What is your experience?

1 Like

And here is the official blog post:

http://blog.ionic.io/announcing-ionic-cli-v3/

:smiley:

Hey @Sujan12,

When I update npm install -g ionic@latest, I still see Ionic CLI Version 2.2.2 when I run ionic info or ionic -v.

Am I missing something?

Thanks,
Ryan

Hmm, worked for me just now:

PS C:\Users\Jan\Documents> ionic -v
3.0.0-rc.1-alpha.4e9bd53a
PS C:\Users\Jan\Documents> npm install -g ionic@latest
C:\Program Files\nodejs\ionic -> C:\Program Files\nodejs\node_modules\ionic\bin\ionic
C:\Program Files\nodejs
`-- ionic@3.0.0
  `-- @ionic/cli-utils@1.0.0
    `-- archiver@1.3.0
      `-- glob@7.1.1
        `-- minimatch@3.0.4

PS C:\Users\Jan\Documents> ionic -v
3.0.0
PS C:\Users\Jan\Documents> ionic info
[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

    @ionic/cli-utils : 1.0.0
    Ionic CLI        : 3.0.0

System:

    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Maybe some kind of npm cache issue? This is really, really hot off the presses :slight_smile:

Thanks for looking into it for me, @Sujan12.

If anyone else has trouble upgrading, it took this SO article for me.

1 Like

i have tried beta version. It was awesome but i moved back to cli 2.2.3 due to some issues with beta versions. Still one issue with CLI 3 is that it will not generate pages for ionic version 2 projects

There is no such thing as an “ionic version 2 project”.

1 Like

how can define this problem specific to my old projects ? ya i know but i find only this way to report my issue

(a) I’m not a huge fan of the generators anyway, and recommend that people just pretend they don’t exist.

(b) If you have problems with unsupported old versions of things, which version 2.x of the framework is at this point, the first question you should ask yourself, and the first question anybody else is going to ask you, is “does the problem persist in the latest supported release version?”. I’ve never used the v3 CLI, so I can’t speak to what issues it does have, but “not supporting unsupported stuff” isn’t a valid one.

1 Like

cool, thx for the news!

P.S.: for an existing project, the ionic blog tell to uninstall ionic first but the ionic-cli doesn’t…I guess it’s better to uninstall it first. I did, it worked…

Hey @reedrichards,

What were the exact commands you used?

Thanks,
Ryan

  1. Uninstall

    npm uninstall -g ionic

  2. Install

    npm install -g ionic@latest

  3. Update project

    npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest @ionic/cli-plugin-cordova@latest

Note: Actually for my global lib, not for these of my project, I added sudo at the begin of the commands too…but this depends of your config

5 Likes

Thank you very much @reedrichards!

1 Like

DO NOT USE SUDO!

There is absolutely no reason to run npm with escalated privileges. It is dangerous and opens you up to all sorts of security problems, along with making it nigh impossible to clean up if there are problems. If on unix, install nvm. If on Windows, install nvm-windows.

What should an OSX user do if they are getting a npm error in terminal saying ‘Please try running this command again as root/Administrator.’

Note: I am logged in to my admin account.

Probably type sudo in front of the command. Which command is causing this?

1 Like

I’m getting this during the npm uninstall -g ionic command, but rapropos just said not to use sudo due to security problems so I was hesitant to run it again as a super user…

He is not wrong. But because of the way you installed your node+npm I think you will have to keep using it. Maybe also uninstall node and reinstall it via nvm- it’s awesome.

1 Like

OK Thanks for the quick help!