How do I prevent tns from updating our runtime from 2.5 to 3.0?



When I try to rebuild our tns project, the cli updates our runtime to 3.0.0.

Everything we’ve tested is against 2.5.0, so we want to stay on 2.5.0 until all our plugins have been updated to NS3.0.

How do I prevent tns from doing this?

My nativescript-cli version is 2.5.4.


Hey Morten,

Great point, this is a bug! We are going to address it immediately! There is a GitHub issue regarding this problem.

Meanwhile, I have a work around for you.

  1. Remove your platforms - tns platform remove [ios/android]
  2. Add platform again - tns platform add [ios/android]
  3. Prepare your project (more info) - tns prepare [ios/android]
  4. Run your app - tns run [ios/android]

You need to go through this flow anytime you remove your platforms (Not very often right :slight_smile: ).

We want to help you with the not migrated plugins as well! Could you share which are the plugins that you need to be migrated?


Thanks for your reply.

The workaround doesn’t work when I try to deploy our app with bundling.
The ns-bundle-script removes the platform and adds it again.
This results in tns-android being 3.0.0 again.

We use a few in-house developed plugins as well as some from NPM.
For now only one of our own plugins is available online:
It adds new properties to the {N}-View-class to add support for accessibility to existing views.

We plan to start porting the plugins after our upcoming release.


To install a specific version of the android (or ios) platform, you need to specify it like so:

tns platform add android@2.5.0


tns platform add ios@2.5.0

One the platform has been added you can then build normally with tns build android or tns build ios.


UPDATE: Just noticed your comment about bundling… sorry–can’t help there.


After updating both nativescript-cli to 2.5.5 and nativescript-dev-webpack to 0.4.2, this have been solved.