Ionic: Your ios platform does not have Api.js

I have started a new ionic v1 project:

  • ionic start todo blank --type ionic1

  • cd todo && ls

  • ionic cordova platform add ios

but with the latest command i get the following error:

   Running command - failed!
   [ERROR] Exception: Using cordova-fetch for ios

    Adding ios project...
    Error: Your ios platform does not have Api.js

If i type the ionic info command i get the following version:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1 

local packages:

Cordova Platforms : none
Ionic Framework   : ionic1 1.3.3

System:

ios-deploy : 1.9.2 
ios-sim    : 6.1.2 
Node       : v6.11.3
npm        : 3.10.10 
OS         : macOS Sierra
Xcode      : Xcode 9.0 Build version 9A235 

Misc:

backend : pro

Which is the problem?

Do the same commands again and add a --verbose to that command. Copy the whole output here for us to look at.

ionic cordova platform add --verbose ios
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: ‘/Users/tom/Documents/IonicTest/test’, local: false, binPath:
‘/usr/local/lib/node_modules/ionic/bin/ionic’, libPath:
‘/usr/local/lib/node_modules/ionic/dist/index.js’ }
[DEBUG] Daemon found (pid: 4001)

cordova platform add ios --save
:heavy_multiplication_x: Running command - failed!
[ERROR] Exception: Using cordova-fetch for ios

    Adding ios project...
    Error: Your ios platform does not have Api.js

How does your platforms folder look like?
Can you run the cordova command directly?