【问题标题】:Error: cmd: Command failed with exit code ENOENT错误:cmd:命令失败,退出代码 ENOENT
【发布时间】:2016-11-28 07:29:42
【问题描述】:

我已经提到了很多关于这个错误的结果。但是没有什么可以帮助我解决这个问题。最初,当我使用 create 命令创建项目时,在命令提示符中收到以下消息。

Using detached cordova-create
Creating a new cordova project.

我不知道为什么会收到 Using detached cordova-create 这条消息。但是项目已创建,当我尝试为 android 添加平台时出现以下错误。

Failed to install 'cordova-plugin-whitelist':Error: cmd: Command failed with exit code ENOENT
Error: cmd: Command failed with exit code ENOENT

我使用cordova plugin ls 列出了插件,并且cordova-plugin-whitelist 1.3.0 "Whitelist" 可用。我不知道为什么会出现这个问题。只是我想学习科尔多瓦。但如果不解决此问题,我将无法继续前进。

请有人帮我解决这个问题。

这是我提到的一些链接。

http://stackoverflow.com/questions/23422961/cordova-cannot-add-android-failed-with-exit-code-enoent
http://stackoverflow.com/questions/31761464/cmd-command-failed-with-exit-code-enoent
http://stackoverflow.com/questions/31089647/cordova-error-code-1-for-command-command-failed-for

【问题讨论】:

  • 您安装了哪些平台(如果有)(cordova platform ls)?
  • @KerriShotts 当我降级科尔多瓦版本时它工作正常。谢谢

标签: android cordova


【解决方案1】:

[这是为了帮助其他有不同情况但相同错误的人]

就我而言,当我运行cordova requirements 时出现了错误。问题是我必须将$ANDROID_SDK_ROOT/tools 添加到路径而不是$ANDROID_SDK_ROOT

所以我在 .bashrc 文件中添加了这个

export ANDROID_SDK_ROOT='/home/your_username/Android/Sdk'

export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_64

然后它运行良好。

Mac OS 参考:

https://gist.github.com/kristopherjohnson/7568583

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-19
    相关资源
    最近更新 更多