Ionic cli not working with Ionic v2

I started a new Ionic v2 project using ionic start MyIonicV2App --v2, then launched npm install and then ionic serve, and everything worked ok.
But when I try to type other commands, like ionic list or ionic state, they don’t work, and display the error message:
This command can only be used when in an Ionic project directory.

When using ionic generate, the error message us:
You do not appear to have a compatible version of Ionic v2 installed. Ionic Framework v2 version 2.0.0-alpha.31 or later is required to use the generators. Please run: "npm install ionic-framework" (CLI v2.0.0-alpha.25)
The output of ionic info is:
`Your system information:

Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Version: 2.0.0-alpha.35
Ionic CLI Version: 2.0.0-alpha.25
Ionic App Lib Version: 2.0.0-alpha.24
OS: Distributor ID: Ubuntu Description: Ubuntu 15.10
Node Version: v4.0.0
`

1 Like