Can't run ionic cordova platform M1 chip

On apple M1 I got an error using ionic cordova platform add. Why I don’t know ? How did I got that ? I don’t know either, all was working almost fine, I mean I got trouble with ionic cordova so I removed the platform using the cli and tried to add it back.

Then the error. Since I moved to M1 I got thousands of errors with ionic cordova (not the cli directly instead of today’s error)

The same repository with no changes from scratch works on mac intel.

Steps to Reproduce:
I don’t know, maybe try using ionic codova with MAC M1, sorry for the lack of details


ionic cordova platform add ios or ionic cordova platform

  throw err;

Error: Cannot find module 'win-release'
Require stack:
- /Users/ecovelo/Projects/appli-usager-v2/node_modules/os-name/index.js
- /Users/ecovelo/Projects/appli-usager-v2/node_modules/insight/lib/index.js
- /Users/ecovelo/Projects/appli-usager-v2/node_modules/cordova/src/telemetry.js
- /Users/ecovelo/Projects/appli-usager-v2/node_modules/cordova/src/cli.js
- /Users/ecovelo/Projects/appli-usager-v2/node_modules/cordova/bin/cordova
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/Users/ecovelo/Projects/appli-usager-v2/node_modules/os-name/index.js:4:18)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19) {
  requireStack: [
[ERROR] An error occurred while running subprocess cordova.
        cordova platform ls exited with exit code 1.
        Re-running this command with the --verbose flag may provide more information.

My ionic info:


   Ionic CLI                     : 6.13.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.3
   @angular-devkit/build-angular : 0.901.15
   @angular-devkit/schematics    : 9.0.7
   @angular/cli                  : 9.0.7
   @ionic/angular-toolkit        : 2.3.3


   Cordova CLI       : not installed
   Cordova Platforms : none
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 23 other plugins)


   cordova-res : 0.15.3
   native-run  : 1.3.0


   Android SDK Tools : 26.1.1 (/Users/ecovelo/Library/Android/sdk)
   ios-deploy        : 1.11.3
   ios-sim           : 8.0.2
   NodeJS            : v15.7.0 (/opt/homebrew/Cellar/node/15.7.0/bin/node)
   npm               : 7.6.3
   OS                : macOS Big Sur
   Xcode             : Xcode 12.4 Build version 12D4e

Other Information:

I’d be glad to give you more information but I gave you all I know. This bug happened after I removed my platform because I got errors before (only on M1) , we tried on intel chip.
Similar issue

I am not able to execute the following on the M1 Mac Mini:

ionic cordova prepare ios

This fairly recent video link seems to corroborate our experiences.

I got so many different errors using Ionic cordova with a M1 chip. The one above is only one from many other. I guess the only answer is do not use ionci cordova with an M1 chip or do not use an M1 chip with ionic cordova.

1 Like