我是离子的新手。我在命令ionic cordova platform add android
上显示时出错。
错误是
C:\Users\user3\Desktop\myApp>ionic cordova build android
> cordova platform add --save android
× Running command - failed!
[ERROR] An error occurred while running cordova platform add --save android (exit code 1):
Using cordova-fetch for cordova-android@^6.2.3
Error: Failed to fetch platform cordova-android@^6.2.3
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: cmd: Command failed with exit code ENOENT[ERROR] An error occurred while running cordova run android (exit code 1).
我的cordova版本为6.2.3
节点js版本为6.11.1
C:\Users\user3\AppData\Local\Android\Sdk
中我的android sdk
我也在使用android studio我的sdk api等级为25。
我正在使用Windows 10
答案 0 :(得分:0)
此配置可能会帮助您
cordova CLI: 7.0.1
Ionic CLI Version: 2.2.0
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.7.0
Xcode version: Not installed
带来这个,使用以下命令
npm install -g ionic@2.2.0
npm install -g cordova@7.0.1
并确保您的node.js版本是v7.7.0,您可以下载此版本