0

I am trying to add iOS platform to my ionic 1 app but I get errors. How can I go further to build my app?

$ cordova platform add ios --save Using cordova-fetch for cordova-ios@~4.3.1 (node:14587) UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch platform cordova-ios@~4.3.1 Probably this is either a connection problem, or platform spec is incorrect. Check your connection and platform name/version/URL. Error: npm: Command failed with exit code 254 Error output: npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^3.6.0 but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/[email protected] requires a peer of @angular/core@* but none is installed. You must install peer dependencies yourself. npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself. npm WARN The package gulp is included as both a dev and production dependency. npm ERR! path /Users/louisro/Documents/BoardLine/node_modules/npm/node_modules/ansistyles npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename '/Users/louisro/Documents/BoardLine/node_modules/npm/node_modules/ansistyles' -> '/Users/louisro/Documents/BoardLine/node_modules/npm/node_modules/.ansistyles.DELETE' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /Users/louisro/.npm/_logs/2018-04-16T21_04_03_502Z-debug.log at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:312:25 at _rejected (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:797:24) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:823:30 at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1142:31) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:808:41) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44 at runSingle (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:137:13) at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13) at process._tickCallback (internal/process/next_tick.js:176:11) (node:14587) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:14587) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 

Here's my package.json:

{ "name": "my app", "app_id": "bc689f", "version": "1.0.0", "description": "newIonic: An Ionic project", "dependencies": { "@ionic-native/globalization": "^3.2.0", "@ionic/cloud": "^0.9.0", "bluebird": "^3.4.6", "cc.fovea.cordova.purchase": "~6.1.2", "cordova-android": "~6.2.3", "cordova-ios": "~4.3.1", "cordova-plugin-admobpro": "~2.29.0", "cordova-plugin-app-version": "~0.1.9", "cordova-plugin-compat": "~1.1.0", "cordova-plugin-console": "~1.0.7", "cordova-plugin-datepicker": "https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git", "cordova-plugin-device": "~1.1.6", "cordova-plugin-extension": "~1.5.1", "cordova-plugin-facebook4": "~1.9.1", "cordova-plugin-geolocation": "~2.4.3", "cordova-plugin-globalization": "~1.0.7", "cordova-plugin-google-analytics": "~1.8.2", "cordova-plugin-googleplus": "~5.1.1", "cordova-plugin-network-information": "~1.3.3", "cordova-plugin-splashscreen": "~4.0.3", "cordova-plugin-statusbar": "~2.2.3", "cordova-plugin-whitelist": "~1.3.2", "cordova-plugin-x-socialsharing": "~5.1.8", "gulp": "^3.5.6", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0", "gulp-sass": "^2.0.4", "ionic-app-lib": "^2.2.0", "ionic-plugin-deploy": "~0.6.7", "ionic-plugin-keyboard": "~2.2.1", "onesignal-cordova-plugin": "~2.1.2" }, "devDependencies": { "@ionic/cli-plugin-cordova": "1.4.0", "@ionic/cli-plugin-gulp": "1.0.1", "@ionic/cli-plugin-ionic1": "2.0.0", "bower": "^1.3.3", "gulp": "^3.9.1", "gulp-replace-task": "^0.11.0", "gulp-util": "^3.0.7", "shelljs": "^0.3.0", "yargs": "^5.0.0" }, "cordovaPlugins": [ { "locator": "https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git", "id": "cordova-plugin-datepicker" }, "ionic-plugin-deploy", "cordova-plugin-extension", "cordova-plugin-admobpro", "cc.fovea.cordova.purchase", "onesignal-cordova-plugin", "cordova-plugin-geolocation", "cordova-plugin-device", "cordova-plugin-network-information", "cordova-plugin-compat", "cordova-plugin-app-version", "cordova-plugin-console", "cordova-plugin-globalization", "cordova-plugin-google-analytics", "cordova-plugin-googleplus", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "cordova-plugin-whitelist", "cordova-plugin-x-socialsharing", "ionic-plugin-keyboard", { "id": "cordova-plugin-facebook4", "locator": "cordova-plugin-facebook4", "variables": { "APP_ID": "3996261696416", "APP_NAME": "my app" } } ], "cordovaPlatforms": [ "[email protected]", { "platform": "android", "version": "", "locator": "android" } ], "main": "gulpfile.js", "scripts": {}, "repository": { "type": "git", "url": "git+https://@bitbucket.org/linedevs/myapp.git" }, "author": "", "license": "ISC", "homepage": "https://bitbucket.org/linedevs/myapp#readme", "cordova": { "platforms": [ "android", "ios" ], "plugins": { "cc.fovea.cordova.purchase": { "BILLING_KEY": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiqWZvb/CV3MWjSvTwRXrD3lt2BG8BGMoFjz8ZyBTkc" }, "cordova-plugin-admobpro": {}, "cordova-plugin-app-version": {}, "cordova-plugin-compat": {}, "cordova-plugin-console": {}, "cordova-plugin-datepicker": {}, "cordova-plugin-device": {}, "cordova-plugin-extension": {}, "cordova-plugin-facebook4": { "APP_ID": "___", "APP_NAME": "my app" }, "cordova-plugin-geolocation": { "GEOLOCATION_USAGE_DESCRIPTION": "Line wants to offer the best experience." }, "cordova-plugin-globalization": {}, "cordova-plugin-google-analytics": {}, "cordova-plugin-googleplus": { "REVERSED_CLIENT_ID": "com.googleusercontent.apps.10ji" }, "cordova-plugin-network-information": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-x-socialsharing": {}, "ionic-plugin-deploy": {}, "ionic-plugin-keyboard": {}, "onesignal-cordova-plugin": {} } } } 

And my ionic info:

$ ionic info [WARN] Error with ./www/lib/ionic/version.json file: FILE_NOT_FOUND, trying ./bower.json. cli packages: (/usr/local/lib/node_modules) @ionic/cli-utils : 1.19.2 ionic (Ionic CLI) : 3.20.0 global packages: cordova (Cordova CLI) : 8.0.0 Gulp CLI : CLI version 3.9.1 Local version 3.9.1 local packages: Cordova Platforms : none Ionic Framework : ionic1 1.3.2 System: Node : v9.11.1 npm : not installed OS : macOS Sierra Environment Variables: ANDROID_HOME : /home/louis/android-sdk-linux/ Misc: backend : pro 
2
  • I think you need to install Cordova Commented Apr 16, 2018 at 21:54
  • Cordova is installed : $ cordova -v gives : 8.0.0 Commented Apr 16, 2018 at 21:56

3 Answers 3

4

First update the NPM

$npm update -g 

then remove and add ios platform

$ionic cordova platform rm ios && ionic cordova platform add ios 
Sign up to request clarification or add additional context in comments.

Comments

0

this did the trick: https://stackoverflow.com/a/45491459/2217647 updating npm allowed $ cordova platform add ios to work.

Comments

0

Try this command instead of just using cordova.

Use this command $ionic cordova platform add ios --save.

And try updating the node modules and npm

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.