I upgraded all my capactior packages to 5.2.2. After doing this I attempted to run ionic cap open ios and it gave me an error saying it could not find the capacitor cli. I double checked my project and the capacitor cli is installed on my project. So I deleted my package-lock.json file and the node_modules folder and did a npm install. Once everything was re-installed I tried again and received the same message. I attempted upgrading ionic references to the lates 7.1 packages as well, and receive the same error. Did I miss a step? Anything else I can check?
I am using turborepo in a mono-repo.
When you revert to a good commit, what version of capacitor do you have? (What was the version before the bad upgrade?)
With 5.2.2, what’s the output of ionic cap?
Capacitor CLI is at version 5.0.4 before the upgrade.
If I attempt to run ionic cap after the upgrade I get the help documentation:
ionic capacitor - Capacitor functionality
These commands integrate with Capacitor, Ionic's new native layer project which provides an alternative to Cordova
for native functionality in your app.
Learn more about Capacitor:
- Main documentation: https://ion.link/capacitor
Usage:
$ ionic capacitor <command> [<args>] [--help] [--verbose] [--quiet] [--no-interactive] [--no-color] [--confirm] [options]
Project Commands:
add ............................. Add a native platform to your Ionic project
build ........................... (beta) Build an Ionic project for a given platform
copy ............................ Copy web assets to native platforms
open ............................ Open the IDE for a given native platform project
run ............................. Run an Ionic project on a connected device
sync ............................ Sync (copy + update) an Ionic project
update .......................... Update Capacitor native platforms, install Capacitor/Cordova plugins
If I run ionic cap build or any of the other commands I get
Error: Capacitor command not found. Is the Capacitor CLI installed? (npm i -D @capacitor/cli)
at Integration.<anonymous> (/usr/local/lib/node_modules/@ionic/cli/lib/integrations/capacitor/index.js:43:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BuildCommand.getInstalledPlatforms (/usr/local/lib/node_modules/@ionic/cli/commands/capacitor/base.js:113:21)
at async BuildCommand.isPlatformInstalled (/usr/local/lib/node_modules/@ionic/cli/commands/capacitor/base.js:129:27)
at async BuildCommand.checkForPlatformInstallation
(/usr/local/lib/node_modules/@ionic/cli/commands/capacitor/base.js:227:19)
at async BuildCommand.preRun (/usr/local/lib/node_modules/@ionic/cli/commands/capacitor/build.js:95:9)
at async BuildCommand.execute (/usr/local/lib/node_modules/@ionic/cli/lib/command.js:42:13)
at async Executor.run (/usr/local/lib/node_modules/@ionic/cli/lib/executor.js:54:9)
at async Executor.execute
(/usr/local/lib/node_modules/@ionic/cli/node_modules/@ionic/cli-framework/lib/executor.js:70:13)
at async Object.run (/usr/local/lib/node_modules/@ionic/cli/index.js:110:9)