Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix no such file - ios/platform_www/cordova.js

When I run ionic cordova prepare ios on my Macbook Air, I get the following error:

ENOENT: no such file or directory, open '/Users/myUserID/Ionic/myApp/platforms/ios/platform_www/cordova.js

I was previously able to run this command but after moving my latest code over (from Windows machine), now suddenly there is an issue.

Any ideas on where to troubleshoot this? Or what causes it?

like image 586
John Cressman Avatar asked Mar 03 '23 14:03

John Cressman


2 Answers

Try the following commands in order:

ionic cordova platform rm android --save
ionic cordova platform add android@latest --save
like image 73
Fearcoder Avatar answered Mar 19 '23 13:03

Fearcoder


It seems the project is missing cordova.js on platforms folder & while building it missing some important files , So you can run below commands for respective platforms.

Android

ionic cordova platform rm android --save
ionic cordova platform add android --save

iOS

ionic cordova platform rm ios --save
ionic cordova platform add ios --save

It should work..

like image 22
Abhijit Chakra Avatar answered Mar 19 '23 13:03

Abhijit Chakra