Closed hcapp01 closed 8 years ago
Hi @hcapp01, here is the exact snippet that produces the error message, from https://github.com/Microsoft/code-push/blob/cf37e1c0529bdc24865611015c4f927c6c875d3f/cli/script/command-executor.ts#L1215:
log(chalk.cyan(`Running "${cordovaCLI} ${cordovaCommand}" command:\n`));
try {
execSync([cordovaCLI, cordovaCommand, platform, "--verbose"].join(" "), { stdio: "inherit" });
} catch (error) {
throw new Error(`Unable to ${cordovaCommand} project. Please ensure that the CWD represents a Cordova project and that the "${platform}" platform was added by running "${cordovaCLI} platform add ${platform}".`);
}
Perhaps you could try running cordova prepare android --verbose
and see what happens?
I'm going to close this for now, but please let me know if you still need help!
This happened to me as well, and after looking into it, I found out the cause is that my node version is too low. I was using node 0.10.33, when I upgrade to 0.12.17, this error was gone.
The lower node version is causing execSync
to be undefined.
I have solved this issue by updating file transfer package. Now code push is working good cordova plugin rm cordova-plugin-file --force cordova plugin add cordova-plugin-file@>=5.0.0 --force
[Error] Unable to prepare project. Please ensure that the CWD represents a Cordova project and that the "android" platform was added by running "cordova platform add android".