NativeScript 3 - Upgrade your existing project(s)

The NativeScript framework is composed of many parts ,the CLI utility ,the runtimes for Android and iOS then the cross platform modules ,so you should make sure to upgrade all these parts ,which is fairly easy ,just follow these steps.

The first thing you need to upgrade is the CLI tool for NativeScript which can be done via npm .So open your terminal or command prompt ,make sure you have Node.js and NPM installed then run :

npm install -g nativescript

If successfully completed ,npm will grab the latest version of NativeScript CLI and install it on your machine .

To make sure you have successfully upgraded to the latest version ,run

tns --version

If you are creating a new project with the upgraded CLI ,you will have all the other parts updated to their latest versions but if you have an existing project created with an older version of NativeScript CLI then you should follow the next steps to upgrade your project to use latest versions of different parts .

Navigate to your project root directory and just enter :

tns update 

This command will upgrade your project with the latest iOS/Android runtimes and cross-platform modules.

Next if you have added an Android platform in your project then you have to remove it using

tns platform remove android

Then add it again

tns platform add android

You can do the same for iOS

tns platform remove ios
tns platform add ios               

Finally upgrade tns core modules via npm with

npm install tns-core-modules@latest --save

These are all the steps which are required to upgrade an existing NativeScript project to the latest available version which when writing this guide :NativeScript 3.0.0

Note: We also publish our tutorials on Medium and If you prefer reading in these platforms, you can follow us there to get our newest articles.

You can reach the author via Twitter:

About the author

Ahmed Bouchefra
is a web developer with 5+ years of experience and technical author with an engineering degree on software development. You can hire him with a click on the link above or contact him via his LinkedIn account. He authored technical content for the industry-leading websites such as SitePoint, Smashing, DigitalOcean, RealPython, freeCodeCamp, JScrambler, Pusher, and Auth0. He also co-authored various books about modern web development that you can find from Amazon or Leanpub

Get our Learn Angular 8 in 15 Easy Steps ebook in pdf, epub and mobi formats, plus a new Angular 8 tutorial every 3 days.

comments powered by Disqus Protection Status