0

I have referred many result regarding this error. But nothing helps me to solve this problem. Initially when i create a project by using the create command am getting following message in command prompt.

Using detached cordova-create
Creating a new cordova project.

I don't know why am getting Using detached cordova-create this message. But project is created and when i try to add platform for android am getting following error.

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

I have listed the plugins using cordova plugin lsand cordova-plugin-whitelist 1.3.0 "Whitelist" is available. I don't know why this problem occurred. Just I want to learn cordova. But I can't move further without fixing this issue.

Please can someone help me to solve this problems.

Here are some links which i referred.

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

1 Answers1

0

[This is to help others with different case but same error]

In my case, the error showed up when I ran cordova requirements. The issue was I had to add $ANDROID_SDK_ROOT/tools to the path and not $ANDROID_SDK_ROOT

So I added this in the .bashrc file

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

And then it ran fine.

Reference for Mac OS:

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

Udayraj Deshmukh
  • 1,814
  • 1
  • 14
  • 22