Could not find ionic.config.json file. Are you in the ion project?

I am new to Ionic and trying to run ionic serveto test my application, but I keep getting this error:

Couldn't find ionic.config.json file. Are you in an Ionic project?

At startup, ionic infoI get the following:

 $ ionic info
******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please update your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

Your system information:

Cordova CLI: undefined
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.1.7
OS: Windows 7
Node Version: v4.4.5

Tried I could not find the ionic.config.json file , but could not solve the problem.

I also get this trace when creating an application with ionic start myApp tabs:

Installing npm packages (may take a minute or two)...
Error with start Error: spawn UNKNOWN
    at exports._errnoException (util.js:870:11)
    at ChildProcess.spawn (internal/child_process.js:298:11)
    at Object.exports.spawn (child_process.js:362:9)
    at spawn (C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_modules\                                                            ionic-app-lib\node_modules\cross-spawn\index.js:17:18)
    at Object.runSpawnCommand (C:\Users\user\AppData\Roaming\npm\node_modules\io                                                            nic\node_modules\ionic-app-lib\lib\start.js:56:17)
    at C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-a                                                            pp-lib\lib\start.js:104:20
    at _fulfilled (C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_mod                                                            ules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\user\AppData\Roaming\npm\node_modules                                                            \ionic\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\user\AppData\Roaming\npm\node_m                                                            odules\ionic\node_modules\q\q.js:749:13)
    at C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:                                                            557:44

Maybe someone can help here.

+4
source share
9 answers

I think your first machine has an ionic version <2.0.0, another โ†’ 2.0.0

If you find a file named ionic.project rename toionic.config.json

, .

+4

ionic.config.json . :

{ "name": " ", "app_id": "," v2 ": true," typescript": true }

"npm install", node_modules.

+3

, , .

$ ionic start myApp tabs
$ cd myApp
$ ionic serve

, .

0
0

, CLI Cordova: undefined. CLI. , .

0

.

npm install -g cordova ionic

ionic start --v2 myApp tabs https://ionicframework.com/getting-started/

0

, .

Mac

  • sudo npm install npm -g
  • sudo npm install -g cordova
  • . minimatch@2.0.10 .

Windows

  • Node.js,
  • npm Node.js , .
  • sudo npm install -g cordova .
  • cordova --version, , .

  • .

, .

0

, ionic.config.json. graceful-fs, :

npm install -g graceful-fs graceful-fs@latest. 

, myApp . myApp - , . .

0

, node v6. ionic info.

It should give you something like "It looks like this is an Ionic Angular project, do you want to install @ ionic / cli-plugin-ionic-angular and continue?"

A type yes

He should have run the following command for you: npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest

Now you can start ionic serveand it will work.

ps above, in my experience, had the same problem, and parsed it above. Hope this is helpful.

0
source

Source: https://habr.com/ru/post/1666801/


All Articles