how to handle circular dependency in node in rollup.js - rollupjs

After switching to npm with workspaces from yarn, I can't make rollup work due to a circular dependency in the node libraries. Was working fine prior to switch to npm and an upgrade to node to 16 (from 12 - also tried node 14).
It is a simple cli tool, with the following dependencies in package.json:
"devDependencies": {
"#rollup/plugin-commonjs": "22.0.1",
"#rollup/plugin-node-resolve": "13.3.0",
"#rollup/plugin-typescript": "8.3.3",
"#types/node": "^16.11.9",
"rollup": "2.77.0",
"rollup-plugin-node-externals": "4.1.1",
"tslib": "2.4.0",
"typescript": "4.7.4",
"watch": "1.0.2"
},
"dependencies": {
"commander": "9.4.0",
"execa": "^6.1.0"
}
rollup.config.js is:
import typescript from '#rollup/plugin-typescript';
import commonjs from '#rollup/plugin-commonjs';
import { nodeResolve } from '#rollup/plugin-node-resolve';
import externals from 'rollup-plugin-node-externals';
export default {
input: 'src/csa.ts',
output: {
dir: 'build',
format: 'cjs',
strict: false,
banner: '#! /usr/bin/env node\n',
},
plugins: [typescript(), commonjs({ transformMixedEsModules: true }), nodeResolve({ preferBuiltins: true }), externals()],
};
result during build is:
src/csa.ts → build...
(!) Circular dependencies
../../node_modules/util/util.js -> ../../node_modules/util/node_modules/inherits/inherits.js -> ../../node_modules/util/util.js
../../node_modules/assert/node_modules/util/util.js -> ../../node_modules/assert/node_modules/inherits/inherits.js -> ../../node_modules/assert/node_modules/util/util.js
created build in 3.6s
and created .js file won't run when attempting to assess function that was circularly referenced:
/Users/me/apps/hrh/csa/packages/cli/build/csa.js:6795
util.inherits(assert.AssertionError, Error);
^
TypeError: util.inherits is not a function
at requireAssert (/Users/me/apps/hrh/csa/packages/cli/build/csa.js:6795:7)
at Object.<anonymous> (/Users/me/apps/hrh/csa/packages/cli/build/csa.js:7231:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47

Resolved by moving typescript() to the end of the plugin array

Related

Unable to set up backend for In app purchases

I have written the cloud functions as per this https://codelabs.developers.google.com/codelabs/flutter-in-app-purchases#0. In the section 10, to verify the purchases a 3rd party Javascript called node-apple-receipt-verify is used. I have added this package in the package.json like this
"dependencies": {
"firebase-admin": "^9.8.0",
"firebase-functions": "^3.14.1",
"node-apple-receipt-verify": "^1.9.3"
},
"devDependencies": {
"#types/node-apple-receipt-verify": "^1.7.0",
"#typescript-eslint/eslint-plugin": "^3.9.1",
"#typescript-eslint/parser": "^3.8.0",
"eslint": "^7.6.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.22.0",
"firebase-functions-test": "^0.2.0",
"typescript": "^3.8.0"
},
Also added the package in the package-lock.json file
In dependencies
"#types/node-apple-receipt-verify": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/#types/node-apple-receipt-verify/-/node-apple-receipt-verify-1.7.0.tgz",
"integrity": "sha512-hjFcvGgA4h14V3M6XPrp5kJU1HHnIsMamME7Bz3TK7w8IcQrEc9b4wm5/p3Tng38oCwxMvDsozVnLEvitvXlkw==",
"dev": true
},
But I am getting this error
src/app-store.purchase-handler.ts:3:37 - error TS2307: Cannot find module 'node-apple-receipt-
verify' or its corresponding type declarations.
3 import * as appleReceiptVerify from "node-apple-receipt-verify";
src/app-store.purchase-handler.ts:10:16 - error TS2664: Invalid module name in augmentation,
module 'node-apple-receipt-verify' cannot be found.
10 declare module "node-apple-receipt-verify" {
~~~~~~~~~~~~~~~~~~~~~~~~~~~
You need to install the node.js package here.

Rails Webpacker React: /bin/webpack-dev-server The command moved into a separate package: #webpack-cli/serve

Today I create a fresh Rails webpacker app with command:
$ rails new my-app --webpacker=react -d mysql
The fresh app generated smoothly until I tried to run:
$ ./bin/webpack-dev-server
The webpack-cli return a message:
The command moved into a separate package: #webpack-cli/serve
Would you like to install serve? (That will run yarn add -D #webpack-cli/serve) (yes/NO) :
I tried to select yes but the installation of webpack-cli is not success with message:
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ #webpack-cli/serve#1.5.2
info All dependencies
└─ #webpack-cli/serve#1.5.2
Done in 2.11s.
TypeError: Class constructor ServeCommand cannot be invoked without 'new'
at runWhenInstalled (/home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:46:9)
at /home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:124:15
at processTicksAndRejections (internal/process/task_queues.js:95:5)
and when I run ./bin/webpack-dev-server command I get error messages:
/home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:46
return func(...args);
^
TypeError: Class constructor ServeCommand cannot be invoked without 'new'
at runWhenInstalled (/home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:46:9)
at promptForInstallation (/home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:140:10)
at /home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/cli.js:32:43
at Object.<anonymous> (/home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
Here is my package.json:
{
"name": "my-app",
"private": true,
"dependencies": {
"#babel/preset-react": "^7.14.5",
"#rails/actioncable": "^6.0.0",
"#rails/activestorage": "^6.0.0",
"#rails/ujs": "^6.0.0",
"#rails/webpacker": "5.4.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"turbolinks": "^5.2.0",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12"
},
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^4.0.0"
}
}
and my node.js version
$ node -v
v14.17.5
For now, temporarily I solve it by using the previous version:
"devDependencies": {
"webpack-dev-server": "^3.11.2"
}
Update:
The webpack-cli & webpack-dev-server at devDependencies of fresh package.json generated by using rails new my-app --webpacker=react are:
"dependencies": {
...
"webpack-cli": "^3.3.12"
...
},
"devDependencies": {
"webpack-dev-server": "^4.0.0"
}
If we see from here, we found that webpack-dev-server v.4.0.0 depends on "webpack-cli": "^4.7.2" which is incompatible with fresh rails webpacker package configurations that use "webpack-cli": "^3.3.12" as dependency.
Usually we can check webpack-cli info by using command npx webpack-cli info. But now when I try, I got an error and found a warning:
$ npx webpack-cli info
...
warning " > #webpack-cli/info#1.3.0" has incorrect peer dependency "webpack-cli#4.x.x".
...
TypeError: Class constructor InfoCommand cannot be invoked without 'new'
at runWhenInstalled (/home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:46:9)
at /home/yohanes/Projects/my-app/node_modules/webpack-cli/bin/utils/prompt-command.js:124:15
at processTicksAndRejections (internal/process/task_queues.js:95:5)
...
For now, the only configurations that work with my environment only:
"dependencies": {
...
"webpack-cli": "^3.3.12"
...
},
"devDependencies": {
"webpack-dev-server": "^3.11.2"
}
Update:
Please see DHH comment here
Case close.

react-native Unable to resolve module 'warnOnce'

my English is little rusty, I'm sorry for that.
I have an error at the moment when I am starting react-native project on the iOS Simulator.
To rule out any conflict with my code, I started a new project
react-native init demo
react-native start
react-native run-ios --simulator="iPhone 6"
Now is when i get the message error
Loading dependency graph, done.
error: bundling failed: Error: Unable to resolve module `warnOnce` from `node_modules/react-native/Libraries/react-native/react-native-implementation.js`: warnOnce could not be found within the project.
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules: rm -rf node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
at ModuleResolver.resolveDependency (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:186:15)
at ResolutionRequest.resolveDependency (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
at Object.resolve (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/transformHelpers.js:267:42)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:426:31
at Array.map (<anonymous>)
at resolveDependencies (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:423:18)
at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
I need to know if anybody have same problem and how fix it ?
My react-native version is 0.61.5
package.json
{
"name": "demo",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.4"
},
"devDependencies": {
"#babel/core": "^7.6.2",
"#babel/runtime": "^7.6.2",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
Thank you for advance.
I found the solution.
I was using react-native-cli.
An advice report in the last react-native documentation , inform that react-native-cli may cause unexpected issues.
I removed react-native-cli and now I'm using
npx react-native ...
Thank you and I'm sorry for my horrible English.
Try by editing the your metro.config.js to
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
resolver: {
blacklistRE: blacklist([
/node_modules\/.*\/node_modules\/react-native\/.*/,
])
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
Refer the thread and answer

Nativescript-Dev-Appium Setup

I am trying to implement nativescript-dev-appium in an existing nativescript-angular project and am having a lot of trouble getting the plugin configured.
The simulator appears to be found but the run fails in the before all and after all hooks because it appears to not have a device instance.
walrus:demo-appium niirds$ npm run e2e -- --runType sim.iPhoneX --verbose
> # e2e /Users/niirds/mobi/demo-appium
> node ./node_modules/nativescript-dev-appium/check-dev-deps.js && tsc -p e2e && mocha --opts ./e2e/config/mocha.opts "--runType" "sim.iPhoneX" "--verbose"
/Users/niirds/mobi/demo-appium/e2e/config/appium.capabilities.json
Capabilities found at: /Users/niirds/mobi/demo-appium/e2e/config/appium.capabilities.json
Appium will use default automation name
Available applications: ["platforms/ios/build/emulator/demoappium.app"]
Pick first application: "platforms/ios/build/emulator/demoappium.app"
Application full path: /Users/niirds/mobi/demo-appium/platforms/ios/build/emulator/demoappium.app
Found devices: [ { token: 'C8B1990E-1593-49A8-AA68-C7E5CC2134BB',
name: 'iPhone X',
status: 'booted',
type: 'watch',
apiLevel: '12.2',
platform: 'ios',
config: { density: 3, offsetPixels: 87 } } ]
1) "before all" hook: start server
2) "after all" hook: stop server
0 passing (2s)
2 failing
1) "before all" hook: start server:
TypeError: Cannot read property 'type' of undefined
at DeviceManager.<anonymous> (node_modules/nativescript-dev-appium/lib/device-manager.js:82:28)
at Generator.next (<anonymous>)
at fulfilled (node_modules/nativescript-dev-appium/lib/device-manager.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
2) "after all" hook: stop server:
TypeError: Cannot read property 'platform' of undefined
at Function.<anonymous> (node_modules/mobile-devices-controller/lib/device-controller.js:104:24)
at Generator.next (<anonymous>)
at /Users/niirds/mobi/demo-appium/node_modules/mobile-devices-controller/lib/device-controller.js:7:71
at new Promise (<anonymous>)
at __awaiter (node_modules/mobile-devices-controller/lib/device-controller.js:3:12)
at Function.uninstallApp (node_modules/mobile-devices-controller/lib/device-controller.js:103:16)
at Object.<anonymous> (node_modules/nativescript-dev-appium/index.js:85:64)
at Generator.next (<anonymous>)
at /Users/niirds/mobi/demo-appium/node_modules/nativescript-dev-appium/index.js:7:71
at new Promise (<anonymous>)
at __awaiter (node_modules/nativescript-dev-appium/index.js:3:12)
at Object.stopServer (node_modules/nativescript-dev-appium/index.js:77:12)
at Object.<anonymous> (e2e/setup.js:16:37)
at Generator.next (<anonymous>)
at /Users/niirds/mobi/demo-appium/e2e/setup.js:7:71
at new Promise (<anonymous>)
at __awaiter (e2e/setup.js:3:12)
at Context.after (e2e/setup.js:15:28)
at process.topLevelDomainCallback (domain.js:121:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # e2e: `node ./node_modules/nativescript-dev-appium/check-dev-deps.js && tsc -p e2e && mocha --opts ./e2e/config/mocha.opts "--runType" "sim.iPhoneX" "--verbose"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is the simulator capability, provided by the installation:
"sim.iPhoneX": {
"platformName": "iOS",
"platformVersion": "/12*/",
"deviceName": "iPhone X",
"noReset": false,
"fullReset": false,
"app": ""
},
I have xcode 10.2 installed, and here is the package.json if that helps.
{
"nativescript": {
"id": "org.nativescript.demoappium",
"tns-android": {
"version": "5.3.0"
},
"tns-ios": {
"version": "5.3.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"scripts": {
"lint": "tslint \"src/**/*.ts\"",
"e2e": "node ./node_modules/nativescript-dev-appium/check-dev-deps.js && tsc -p e2e && mocha --opts ./e2e/config/mocha.opts ",
"e2e-watch": "tsc -p e2e --watch"
},
"dependencies": {
"#angular/animations": "~7.2.0",
"#angular/common": "~7.2.0",
"#angular/compiler": "~7.2.0",
"#angular/core": "~7.2.0",
"#angular/forms": "~7.2.0",
"#angular/http": "~7.2.0",
"#angular/platform-browser": "~7.2.0",
"#angular/platform-browser-dynamic": "~7.2.0",
"#angular/router": "~7.2.0",
"nativescript-angular": "~7.2.0",
"nativescript-theme-core": "~1.0.4",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.3.0",
"tns-core-modules": "~5.3.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"#angular/compiler-cli": "~7.2.0",
"#nativescript/schematics": "~0.5.0",
"#ngtools/webpack": "~7.2.0",
"#types/chai": "~4.1.7",
"#types/mocha": "~5.2.5",
"#types/node": "~10.12.18",
"codelyzer": "~4.5.0",
"mocha": "~5.2.0",
"mocha-junit-reporter": "~1.18.0",
"mocha-multi": "~1.0.1",
"nativescript-dev-appium": "^5.1.0",
"nativescript-dev-sass": "~1.7.0",
"nativescript-dev-typescript": "~0.9.0",
"nativescript-dev-webpack": "~0.21.0",
"tslint": "~5.11.0"
},
"gitHead": "6ccaee804c71761be1c2f91d0b2dd67c8ba6d2b6",
"readme": "NativeScript Application"
}
Steps to reproduce:
1. create sample nativescript-angular app--i used the tab navigation one for this test.
2. install nativescript-dev-appium: npm i -D nativescript-dev-appium
3. install other dependencies https://docs.nativescript.org/angular/tooling/testing/end-to-end-testing/overview#environment-setup
4. build app: tns build <platform>
5. run test: `npm run e2e -- --runType
i have been trying to get this to work on iOS for now.
Any help will be greatly appreciated!
I think that for some reason the device type that device controller has returned type: 'watch' is not correct.
I suggest you change the config to something like:
"sim.iPhoneX": {
"platformName": "iOS",
"platformVersion": "12.2",
"deviceName": "iPhone X",
"noReset": false,
"fullReset": false,
"app": ""
},
or simply try it with the --ignoreDeviceController option.

Can't add iOS platform to ionic app, Mac OS

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/globalization#3.14.0 requires a peer of #ionic-native/core#^3.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ionic-native/globalization#3.14.0 requires a peer of #angular/core#* but none is installed. You must install peer dependencies yourself.
npm WARN #ionic-native/globalization#3.14.0 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": [
"android#6.1.0",
{
"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
First update the NPM
$npm update -g
then remove and add ios platform
$ionic cordova platform rm ios && ionic cordova platform add ios
this did the trick: https://stackoverflow.com/a/45491459/2217647
updating npm allowed $ cordova platform add ios to work.
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

Resources