12
votes

I just updated nodejs ionic and cordova. Create new ionic project as before:

ionic start myApp blank 

In terminal, go to myApp directory, and input:

ionic state

I got message:

You cannot run any state commands on a project that is not an Ionic project. Try adding an ionic.project file or running ionic start to get an application to save or restore (CLI v1.7.10)

My system information:

  • Cordova CLI: 5.4.0
  • Ionic Version: 1.1.1
  • Ionic CLI Version: 1.7.10
  • Ionic App Lib Version: 0.6.5
  • ios-deploy version: 1.8.3
  • ios-sim version: 5.0.4
  • OS: Mac OS X El Capitan
  • Node Version: v5.1.0
  • Xcode version: Xcode 7.1.1 Build version 7B1005

Question: Where ionic.project file, I don't remember there was this file in project before. How to add ionic.project file?

How do I find this problem? Because I check out source from git, I try to use ionic state restore command to restore application for building. But I got same message, missing ioinc.project. So I create a new ionic project to find reason, but I'm still confused.

If use

ionic start

You will got

Invalid command (CLI v1.7.10)

Of course, there is not directory argument for this command. If you give directory as ./, this command only create and overwrite all project file.

screen shot enter image description here

4
Did you type this command from project directory?[Move to project directory cd myApp command]?Muhsin Keloth
@Muhsin yes, I input ionic command in project directory. cd myApp before input ionic state.Gino
Could you please share screen shot of your project structure and terminal?Muhsin Keloth
@Muhsin add screen shotGino

4 Answers

32
votes

The new name of this file is ionic.config.json

18
votes

I was facing the same issue. just run the command

ionic serve

ionic.project file gets auto generated

EDIT

ionic.project is replace by ionic.config.json. So you should change in ionic.config.json

0
votes

If you are happened to use ionic@beta, it won't install it until you downgrade it to ionic V1 then "ionic setup sass" or "ionic serve".

0
votes

Most simple/easy solution to this problem to install a chrome extension named CORS. and everything will work perfectly.