[IONIC] Error: ENOENT: no such file or directory when running Ionic Cordova

Table of Contents

[IONIC] Error: ENOENT: no such file or directory

This error appears when I run Capacitor first, then I decide to change to Cordova

ionic cordova run android -l -c

image

image

How to fix Error: ENOENT: no such file or directory when running Ionic Cordova

https://stackoverflow.com/questions/67118445/error-enoent-no-such-file-or-directory-when-running-ionic-cordova-platform-add

I was running with the same error and today I found out the solution. In the past, I tried a capacitor plugin, but my project is cordova, so I removed it from my project. But I think that some files were not properly deleted and when I ran ionic repair, the problem started. So, to repair this I deleted the ANDROID folder at project root, any files related to Capacitor at root, edited the package.json and removed everything related with Capacitor and everything works again.

Solution

  1. Delete the android folder at project root
  2. Edit the package.json and remove everything related with Capacitor

image

Leave a Reply

Your email address will not be published. Required fields are marked *