Downgrading to Ionic 3?

Hi all,

I have an app I wrote several years ago under Ionic 3. I was asked to port it to Ionic 5 on a VERY short timeline. I’ve tried for days, but Angular and Ionic has changed so much over the past few years that I just don’t have time to port it immediately. Angular isn’t my native language, unfortunately, and I just don’t have time at the moment to port from Ionic3 to Ionic5 with all the changes. :frowning:

In the process of upgrading, I got my env to this:
Ionic:

Ionic CLI : 6.16.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.6.8
@angular-devkit/build-angular : 12.0.1
@angular-devkit/schematics : 12.0.1
@angular/cli : 12.0.1
@ionic/angular-toolkit : 4.0.0

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v14.17.0 (/usr/local/bin/node)
npm : 6.14.13
OS : macOS Big Sur

Can anyone help me get everything set back to Ionic3 so I can at least bring up the app? I’ll port later, as time allows. Is it just a matter of adding a version to all the npm commands? As in:
npm install -g ionic@version

I’ve run npm install -g ionic@3.20.0 and that worked, but when I run ionic serve, it complains that I have to install the ionic-app-scripts, and that fails when building sass. That error is Failed at the node-sass@4.5.3 postinstall script. Researching how to get around that now…

Does anyone know if there’s a Docker or BusyBox/Fusion/etc. image that recreates the right environment? That’d work, too. I’ll go look for that now.

Any pointers/help/suggestions are gratefully accepted!

Thanks for your time,

Bret

Your best bet would be to just use version control to revert to the version before you started messing around with things.

Not a great idea. The globally-installed CLI is designed to interoperate with any number of projects using different framework versions, so it is the absolute last thing you want to be downgrading. All that should concern you is the stuff declared in the package.json of your project directory.

The CLI and Framework are separate. To see the version of Ionic Framework you’re using, see package.json. The Ionic CLI is backward compatible, so I recommend:

npm install -g ionic@latest

then run “npm install” within the project and ionic serve.

Thanks for the replies, @rapropos and @netkow!

I found a backup I took when the project was running and extracted it. The package.json shows this:
“dependencies”: {
@angular/common”: “5.0.3”,
@angular/compiler”: “5.0.3”,
@angular/compiler-cli”: “5.0.3”,
@angular/core”: “5.0.3”,
@angular/forms”: “5.0.3”,
@angular/http”: “5.0.3”,
@angular/platform-browser”: “5.0.3”,
@angular/platform-browser-dynamic”: “5.0.3”,
@ionic-native/core”: “4.4.0”,
@ionic-native/splash-screen”: “4.4.0”,
@ionic-native/status-bar”: “4.4.0”,
@ionic/pro”: “1.0.16”,
@ionic/storage”: “2.1.3”,
@types/npm”: “^2.0.29”,
@types/xml2json”: “^0.10.0”,
“child_process”: “^1.0.2”,
“childprocess”: “^2.0.2”,
“cordova-android”: “6.3.0”,
“defiant”: “^1.4.5”,
“fs”: “file:node_modules/fs”,
“ionic-angular”: “3.9.2”,
“ionicons”: “3.0.0”,
“json-query”: “^2.2.2”,
“json2typescript”: “^1.0.5”,
“jsonpath”: “^1.0.0”,
“node-jq”: “^1.2.0”,

… (cut off - let me know if you need more)

Mark - I ran the npm install -g ionic@latest in my project, then ran npm install there, too.

The npm install failed:
26462 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
26463 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 install: node install
26463 warn optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
26464 verbose optional SKIPPING OPTIONAL DEPENDENCY:
26464 verbose optional Failed at the fsevents@1.1.3 install script.
26464 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
26465 verbose stack Error: node-expat@2.3.16 install: node-gyp rebuild
26465 verbose stack Exit status 1
26465 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
26465 verbose stack at EventEmitter.emit (events.js:376:20)
26465 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
26465 verbose stack at ChildProcess.emit (events.js:376:20)
26465 verbose stack at maybeClose (internal/child_process.js:1055:16)
26465 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
26466 verbose pkgid node-expat@2.3.16
26467 verbose cwd /Users/bret/personal/TTV/ttvBMD/backup/040518_1322/tmp
26468 verbose Darwin 20.3.0
26469 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “install”
26470 verbose node v14.17.0
26471 verbose npm v6.14.13
26472 error code ELIFECYCLE
26473 error errno 1
26474 error node-expat@2.3.16 install: node-gyp rebuild
26474 error Exit status 1
26475 error Failed at the node-expat@2.3.16 install script.
26475 error This is probably not a problem with npm. There is likely additional logging output above.

fsevents and node-gyp didn’t want to install. :frowning: Any thoughts? Need more info/log files?

FWIW, ionic info now shows:
tmp CreateContestSlides % ionic info
[WARN] Detected locally installed Ionic CLI, but it’s too old–using global CLI.

Ionic:

Ionic CLI : 5.4.16 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.5

Cordova:

Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

cordova-res : not installed
native-run : not installed

System:

NodeJS : v14.17.0 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS Big Sur
Xcode : Xcode 12.5 Build version 12E262

Thanks in advance for ANYTHING you can help with, guys!

Bret

Hey, quick update… I missed this error in the node install, right up at the top (it scrolled by too fast to see):
tmp CreateContestSlides % sudo npm install

fsevents@1.1.3 install /Users/bret/personal/TTV/ttvBMD/backup/040518_1322/tmp/node_modules/fsevents
node install

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v83-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and node@14.17.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v83-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and node@14.17.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)

Looks like it tried to download a prebuilt binary for fsevents 1.1.3 that was compatible with node v14.17.0 and couldn’t find one. I’m guessing my current node version (14.17.0) is too new for the prebuilt versions… Is this telling me to downgrade node to v8.3? I can only find v10, v12, and v14 via homebrew - 8 is probably way too old. I was able to find a v8.17 at nodeJS, so I installed it, then reran “npm install” and was able to run ionic serve to get my code running. ionic lab isn’t working at the moment, but I’m making progress!

Thanks so much for taking time to look at this, guys! :slight_smile:

Regards,

Bret