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

Error while parsing Capacitor CLI version. #4720

Closed
nchrysis opened this issue Jun 15, 2021 · 6 comments
Closed

Error while parsing Capacitor CLI version. #4720

nchrysis opened this issue Jun 15, 2021 · 6 comments
Labels

Comments

@nchrysis
Copy link

Description:
Running command: ionic cap run android -l --external failed instantly with message:
[ERROR] Error while parsing Capacitor CLI version.
This happens on versions of @ionic/cli >= 6.16.0. On versions earlier than 6.16.0 app runs successfully with no problems.
I had installed latest version of @ionic/cli with the command: npm i -g @ionic/cli

ionic cap run android -l --external --verbose
Output:

ionic:lib Terminal info: { ci: false, shell: '/bin/zsh', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'cap', 'run', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, l: true, external: true, project: null, '--': [] } +2ms
ionic:lib:project Project type from config: @ionic/react (react) +0ms
ionic:lib:project Project details: { context: 'app', type: 'react', errors: [], configPath: '/home/USER/APP/PATH/ionic.config.json' } +1ms
ionic Context: { binPath: '/home/USER/.npm-global/lib/node_modules/@ionic/cli/bin/ionic', libPath: '/home/USER/.npm-global/lib/node_modules/@ionic/cli', execPath: '/home/USER/APP/PATH/', version: '6.16.1' } +0ms
[ERROR] Error while parsing Capacitor CLI version.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 0 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +0ms

My ionic info:

Ionic:

   Ionic CLI       : 6.16.3 (/home/USER/.npm-global/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/react 5.6.9

Capacitor:

   Capacitor CLI   : [warn] The hideLogs configuration option has been deprecated. Please update to use loggingBehavior instead. 3.0.1
   @capacitor/core : 3.0.1

Utility:

   cordova-res : not installed
   native-run  : 1.4.0

System:

   NodeJS : v14.16.0 (/usr/bin/node)
   npm    : 7.15.1
   OS     : Linux 5.9

Using version 6.15.0 of @ionic/cli seems to have fixed the issue for me but sadly I cannot use the latest version yet.

@ionitron-bot ionitron-bot bot added the triage label Jun 15, 2021
@ItayElgazar
Copy link

same here. any ideas?

@ItayElgazar
Copy link

bump?

@jcesarmobile
Copy link
Member

there was an issue open on Capacitor repo about capacitor doctor command not working on linux

ionic-team/capacitor#3747

but looks like it works fine in Capacitor 3

can you try running npx cap doctor directly and if you get an error comment on the issue I provided?

@jcesarmobile
Copy link
Member

I've been able to reproduce, the problem is you have hideLogs in you capacitor.config.json file, which is deprecated, which makes the CLI show a warning about it being deprecated, which breaks the version parsing.

You can solve it by moving to loggingBehavior, but should be fixed anyway

@nchrysis
Copy link
Author

nchrysis commented Jul 8, 2021

Today I changed to loggingBehavior because I saw that warning. Have not yet bumped @ionic/cli to latest version. Will let you know if it fixed the issue for me. Thank you very much!

@jcesarmobile
Copy link
Member

Will be fixed in next @capacitor/cli release
ionic-team/capacitor#4813

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

No branches or pull requests

3 participants