Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migration Steps to NativeScript 5.0

Emil Tabakov edited this page Jan 4, 2019 · 2 revisions

{N} 5.0 is now available and document outlines simple steps that you need to take in order to migrate your applications! The major features and improvements it includes are listed in our release notes.

Install {N} CLI

npm un -g nativescript
npm i -g nativescript@latest

Update Android SDK

{N} 5.0 will require Android SDK 28. You can update it with following steps:

$ANDROID_HOME/tools/bin/sdkmanager --licenses
$ANDROID_HOME/tools/bin/sdkmanager "tools"
$ANDROID_HOME/tools/bin/sdkmanager "platform-tools"
$ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3"
$ANDROID_HOME/tools/bin/sdkmanager "platforms;android-28"

By completing these steps your system should be updated and if you run tns doctor it should report that everything is ok and the system is set up to use latest packages. Now, it's time to update your NativeScript applications one at a time.

Navigate to your app

cd <your-app>

Cleanup before upgrade

tns platform remove android 
tns platform remove ios
rm -rf node_modules
rm -rf platforms
rm -rf hooks

Update {N} core packages

tns update latest

Update {N} angular (only for Angular projects)

npm un nativescript-angular --save
npm i nativescript-angular@latest --save
./node_modules/.bin/update-app-ng-deps
npm i

Update {N} webpack (only if used in your project)

npm un nativescript-dev-webpack --save-dev
npm i nativescript-dev-webpack@latest --save-dev
./node_modules/.bin/update-ns-webpack --configs --deps
npm i

Update nativescript-ui-listview and nativescript-ui-sidedrawer (only if used in your project)

npm un nativescript-ui-listview --save
npm i nativescript-ui-listview@latest --save
npm un nativescript-ui-sidedrawer --save
npm i nativescript-ui-sidedrawer@latest --save
# If you are using the RadListView or the RadSideDrawer you will need to update all other PRO UI components if any to avoid conflicting versions of the ui-core package in iOS.
Clone this wiki locally