Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm getting an error when building an Ionic 3 app

I just updated to Mac Mojave(I'm sure if that the cause of my issue).

The problem is that every time i try to build my app using the command.

ionic cordova build ios

I get the following error.

CordovaError: Promise rejected with non-error: 'ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do \'npm install -g ios-deploy\''
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)

enter code here[ERROR] An error occurred while running subprocess cordova.

    cordova build ios exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

I figured i need to install the ios-deploy so i ran this command.

npm install -g ios-deploy

But i get the following error.

npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! [email protected] preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 65
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2018-10-15T15_07_47_819Z-debug.log

I have being searching everywhere for answers but I can't find it.

like image 652
Millenial2020 Avatar asked Oct 15 '18 15:10

Millenial2020


People also ask

How do I get the app version in Ionic 3?

Using getVersionNumber function you can get the version.

Do I need Android SDK for Ionic?

We don't recommend using Android Studio for developing Ionic apps. Instead, it should only really be used to build and run your apps for the native Android platform and to manage the Android SDK and virtual devices.


2 Answers

It seems that in the ionic forum there is a thread regarding this or a really similar issue: ionic forum link

To sum it up a bit, there is some issue with XCode or some dependencies not being at the expected place.

Could you try the following (add sudo if it fails for permission reasons):

npm install -g ios-deploy --unsafe-perm=true

like image 118
George Avatar answered Sep 21 '22 13:09

George


I was also having this problem. Turns out all I had to do was disconnect my iPhone from the USB port.

  1. Disconnect any iOS devices from USB
  2. Build your app and wait until it finishes
  3. Reconnect the device
like image 31
Twyx Avatar answered Sep 20 '22 13:09

Twyx