Cordova Error: Your ios platform does not have Api.js

故事扮演 提交于 2019-11-27 21:47:32

I'm guessing that attempting to use deprecated code is the reason for seeing the error message.

It appears that one should be using the latest version of node. I also performed all my software updates for Xcode. I also connected my iPhone to my computer. Even after that (and before I updated node) I was still seeing this:

cordova platform add ios

Warning: using node version v0.12.0 which has been deprecated. Please upgrade to the latest node version available (v6.x is recommended).
Using cordova-fetch for cordova-ios@^4.4.0
Adding ios project...
Error: Your ios platform does not have Api.js

Then I decided to resolve the warning by updating node. And finally success:

sudo n latest
node --version
=> v8.0.0

cordova platform rm ios
cordova platform add ios

Using cordova-fetch for cordova-ios@~4.4.0
Adding ios project...
Creating Cordova project for the iOS platform:
    Path: platforms/ios
    Package: com.example.hello
    Name: HelloWorld
iOS project created with cordova-ios@4.4.0
Installing "cordova-plugin-whitelist" for ios
--save flag or autosave detected
Saving ios@~4.4.0 into config.xml file ...

I was having exactly this problem but managed to solve it by simply removing and then adding the IOS platform within my project:

cordova platform rm ios
cordova platform add ios

This seemed to fix whatever had somehow got broken when updating Cordova...

Has same issue with latest version of cordova (7.0.1)

Faced error while adding iOS platform and managed to resolve it by upgrading nodeJS to latest version (6.11.1)

For those of you that have tried updating your NodeJs and that didn't work.

Go check in your platforms/android or platforms/ios folder. Mine was empty. Delete the folder, and run ionic cordova add android/ios again.

use cordova@6.0 solved the problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!