NativeScript: Downgrading to 2.5

If you are needing to use a plugin that hasn't been upgraded to support 3.0 you basically have three choices, and guess what I can help with each of them...

  1. Wait for it to be updated; you can check my site http://plugins.nativescript.rocks; then select the "3.0" plugins list, now you can easily see when a plugin has 3.0 compatibility.
  2. Update it your self; or since I'm a contractor; you pay me; I will upgrade the plugin for you.
  3. Downgrade to NativeScript 2.5; I suspect most of you are the most interested in this since you are here...

The good news is that several of the 3.0 parts are backwards compatible.  You can be running the 3.0 NativeScript command line and build 2.5 apps.  You can also be using the 3.0 release runtimes with the core 2.5. modules.  So here is the way to downgrade a 3.0 app into a 2.5 app.

 

To downgrade PAN (Plain Awesome NativeScript) apps:

npm install tns-core-modules@2.5.2 --save
npm remove nativescript-dev-android-snapshot --save-dev
tns platform clean ios
tns platform clean android

If you are using TypeScript in your apps you need to do:

npm install typescript@2.1.6 --save-dev
npm install nativescript-dev-typescript@0.3.7 --save-dev

To Downgrade NAN (NativeScript ANgular) apps:

npm install --save @angular/animations@~4.0.0
npm install --save @angular/common@~4.0.0
npm install --save @angular/compiler@~4.0.0
npm install --save @angular/core@~4.0.0
npm install --save @angular/forms@~4.0.0
npm install --save @angular/http@~4.0.0
npm install --save @angular/platform-browser@~4.0.0
npm install --save @angular/platform-browser-dynamic@~4.0.0
npm install --save @angular/router@~4.0.0
npm install --save nativescript-angular@~1.5.0
npm install --save reflect-metadata@^0.1.8
npm install --save rxjs@~5.2.0
npm install --save zone.js@~0.8.4
npm install --save tns-core-modules@2.5.2

npm install --save-dev @angular/compiler-cli@~4.0.0
npm install --save-dev babel-traverse@6.15.0
npm install --save-dev babel-types@6.15.0
npm install --save-dev babylon@6.11.2
npm install --save-dev htmlparser2@^3.9.2
npm install --save-dev Lazy@1.0.11
npm install --save-dev typescript@2.1.6
npm install --save-dev nativescript-dev-typescript@0.3.7
npm remove --save-dev nativescript-dev-android-snapshot

tns platform clean ios
tns platform clean android


One note that seems to confuse some people; you can continue to use the NativeScript 3.0 CLI with NativeScript 2.5 applications.  You can also use the 3.0 Runtimes (highly recommended actually) with your 2.5 Core modules applications.

Any of my 2.5 applications are now (This setup is fully 2.5 plugin compatible):
- 3.0 CLI
- 3.0 Runtimes
- 2.5 TNS Core Modules (if NAN, then you need the old Angular stuff as listed above)

And my 3.0 applications are (This is the standard 3.0 setup)
- 3.0 CLI
- 3.0 Runtimes
- 3.0 TNS Core Modules  (if NAN, then you need the new 3.0 compatible Angular Stuff)

 

3 comments

  1. Tnx for the info!
    Tried this with the 2.5.4 cli but it did not work. The 2.5 cli updates your runtime to 3 when you run platform clean. So you need to upgrade your cli to 3 to make this work

    1. You are correct, I wrote this from the perspective that you already installed 3.0, where the platform clean works properly. However, just so you know; you can use the Android 3.0 runtimes in a 2.5 application.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.