无法将插件或平台添加到ionic3项目中

时间:2018-04-06 07:44:21

标签: ionic3 cordova-plugins

只要我运行命令 cordova add platform ionic cordova插件添加https://github.com/moust/cordova-plugin-videoplayer.git ,我就会收到以下错误。

**(node:5072) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): CordovaError: Cordova does not know add; try `cordova help` for a l
ist of all the available commands.
(node:5072) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.**

我试过降解cordova但它没有用。我该如何解决这个问题?

编辑: cordova平台添加android 给了我错误:

Using cordova-fetch for cordova-android@~7.0.0
(node:3444) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): CordovaError: Failed to fetch platform cordova-android@~7.0.0
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
(node:3444) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

2 个答案:

答案 0 :(得分:0)

您输入的命令行错误。命令行是

$ ionic cordova platform add android

$ cordova platform add android

答案 1 :(得分:0)

使用

 $ cordova platform add android