Cordova错误:您的ios平台没有Api.js [英] Cordova Error: Your ios platform does not have Api.js
问题描述
我正在尝试构建一个cordova ios应用程序,但运气不佳,并且遇到奇怪的错误.
I'm trying to build a cordova ios app but not having much luck and getting strange errors.
将此版本的Cordova与旧版本的cordova-ios结合使用是 不推荐使用.升级到cordova-ios@4.0.0或更高版本.
Using this version of Cordova with older version of cordova-ios is deprecated. Upgrade to cordova-ios@4.0.0 or newer.
错误:您的ios平台没有Api.js
Error: Your ios platform does not have Api.js
第一个警告说我的cordov-ios版本很旧,这很奇怪,因为这是我的输出:
The first warning says my cordov-ios version is old, which is strange as this is my output:
$ cordova --version
7.0.1
$ cordova platform version ios
Installed platforms:
ios 4.4.0
Available platforms:
android ~6.2.2
blackberry10 ~3.8.0 (deprecated)
browser ~4.1.0
osx ~4.0.1
webos ~3.7.0
所以我显然拥有必要的最新版本.
So I clearly have the latest versions necessary.
,然后出现Api.js
错误.是什么原因造成的?
And then the Api.js
error. What is causing this?
错误:您的ios平台没有Api.js
Error: Your ios platform does not have Api.js
有什么想法吗?
推荐答案
我猜测尝试使用不赞成使用的代码是看到错误消息的原因.
I'm guessing that attempting to use deprecated code is the reason for seeing the error message.
似乎应该使用的是最新版本的节点.我还对Xcode执行了所有软件更新.我也将iPhone连接到计算机.即使在那之后(并且在我更新节点之前),我仍然看到了这一点:
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 ...
这篇关于Cordova错误:您的ios平台没有Api.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!