0

I have a project on ionic 2, which I have not touched for 3 years, but the client is asking me to change a simple link. And I can not build the application. What should I take into account to recover this project?

I do not want to migrate to ionic 3 or ionic 4, I just want to change the webservices link and that the application continues in ionic 2.

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : not installed

local packages:

@ionic/app-scripts : 1.1.4
Cordova Platforms  : none
Ionic Framework    : ionic-angular 2.2.0

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2
Node              : v8.9.3
npm               : 5.5.1
OS                : macOS
Xcode             : Xcode 10.1 Build version 10B61

Is it possible to build this old project on ionic 2 on my computer?


EDIT: when sudo ionic cordova platform add android i get:

`(node:41668) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform cordova-android@7.0.0 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 1 Error output: npm WARN @ionic/app-scripts@1.1.4 requires a peer of @angular/tsc-wrapped@* but none is installed. You must install peer dependencies yourself. npm WARN @ionic/cli-plugin-ionic-angular@1.3.1 requires a peer of @ionic/app-scripts@^1.3.7 but none is installed. You must install peer dependencies yourself.

npm ERR! Cannot read property '0' of undefined`

Lousmar G.
  • 11
  • 1
  • 3
  • What Errors are you facing. Please Share errors also – Najam Us Saqib Jun 20 '19 at 16:56
  • 1
    Check this link: https://stackoverflow.com/q/35451207/5909026 Also try to remove platform first and add again. also try `npm rebuild node-sass` this command – Najam Us Saqib Jun 20 '19 at 17:04
  • Well, a lot of dependencies may have been changed in that time, so you'd need to update a few things to make the project work again. This doesn't mean to update Ionic from v2 to v3 or v4, is just that the Ionic CLI, the Cordova CLI, the Cordova Android platform and even most of the Cordova plugins may need to be updated to make the project to build again. I guess I'll recommend to remove the `node_modules`, `platforms` and `plugins` folders, and start adding the plugins one by one to see which one is causing the issues... – sebaferreras Jun 21 '19 at 08:33
  • ^ If you want to do that, you may need to remove your plugins from the `config.xml` and the `packages.json` files (but keeping somewhere else what version of each plugin was installed) so you can add the Android platform without any plugins, and then start adding one by one using the `ionic cordova plugin add cordova-plugin-something@1.2.3` command (where `1.2.3` is the same version you saw in the `package.json` or `config.xml` files). – sebaferreras Jun 21 '19 at 08:35
  • There are so many possibilities. try to uninstall node_modules and install it again same with cordova. if its still present need to debug . is your repository is open or available ? – Wasiq Muhammad Jun 23 '19 at 10:50

1 Answers1

0

u should install Cordova first, like this,use @ plus version number as needed

npm install -g cordova

joker
  • 51
  • 5