Ionic capacitor add ios is failing

capacitor add ios
:information_source: Installing iOS dependencies – Skipping: already installed
:heavy_check_mark: Adding native xcode project in: in 952.62ms
:heavy_check_mark: add in 955.85ms
:heavy_check_mark: Copying web assets from www to ios/App/public in 30.15s
:heavy_check_mark: Copying native bridge in 30.90ms
:heavy_check_mark: Copying capacitor.config.json in 26.04ms
[error] Unable to find node_modules/cordova-ios. Are you sure cordova-ios is installed?
[ERROR] An error occurred while running subprocess capacitor.

    capacitor add ios exited with exit code 1.
    Re-running this command with the --verbose flag may provide more information.

any thoughts?

So did you do that as instructed?

I did do that, and it didn’t relay any helpful information for me, and now I am now confused about something in context to this. I was going to copy-paste the results of your suggestion, but … when I first was getting this error, I noticed the folder called [cordova-ios] was not present in my [node_modules] folder. I had suspicions it was the root of the problem. So I was trying to figure out how to perhaps refresh the node_modules. I did a series of things to do so and now I can’t remember what I did, but the [cordova-ios] folder is now in the [node_modules] folder and it ran okay this time. I apologize for the vague nature of what solved this for me. Maybe somebody with more experience may know how to shed proper light on this. All being said, it is now working for me.

The successful solution is:
In the file: “capacitor.config.json” should be “webDir”: “src”

1 Like

Thanks @Ammar_Bareesh

Thanks, this work’s for me !!
But, why this happened @Ammar_Bareesh ?