Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cordova prepare android @10.x.x fails, on Windows, with \cordova\version is not recognized as an internal or external command #1392

Closed
3 tasks done
simonjmartin opened this issue Dec 13, 2021 · 2 comments

Comments

@simonjmartin
Copy link

Bug Report

Problem

After upgrading to v10 when I run cordova prepare android the process fails with
"...\platforms\android\cordova\version"' is not recognized as an internal or external command"

What is expected to happen?

The app should be prepared for android without error

What does actually happen?

the process fails with
"...\platforms\android\cordova\version"' is not recognized as an internal or external command"

Information

Issuing the command in my terminal produces the same error, but as it looks like it's trying to invoke the file if I prepend the line with 'node' then the version is correctly returned and there are no errors.
If I downgrade from v10.x to v9 and compare the folder contents, version.bat has been removed, which was part of apache/cordova-ios#1180 also apache/cordova-ios#1180 (comment)
As a workaround I have copied version.bat from the v9 folder and paste it into the folder after reverting to v10.1.1 - but this shouldn't be necessary.
This is only an issue on Windows, macs seem to respect the shebang #!/usr/bin/env node statement at the top of the plain version file

Command or Code

cordova prepare android

Environment, Platform, Device

Windows 10

Version information

Android Cordova 10.1.1
Windows 10
npm 6.14.13
node 14.17.1
Powershell 7.2.0 or regular Windows cmd

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@jcesarmobile jcesarmobile transferred this issue from apache/cordova-ios Jan 17, 2022
@breautek
Copy link
Contributor

breautek commented Feb 5, 2022

Is there any other information about your environment you can share?

I just tested this in a windows 10 environment on a simple hello world app, which doesn't reproduce the issue.

@breautek
Copy link
Contributor

duplicate: #1395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants