NativeScript CLI installation
The purpose of this section is to guide you to install the NativeScript CLI in your development environment. The NativeScript CLI provides a set of commands to create, build, and deploy NativeScript-based projects on iOS and Android devices.
The NativeScript CLI is a node package that you can install from node packet manager npm.
If you have no clue on how to install or where to find a node.js package, search for its name on npm search:
Click on the nativescript link. You will land on the NativeScript Command-Line Interface GitHub page.
Take time to read all detailed information supplied in this page.
Open a Command Prompt and type:
> npm install nativescript -g
Installation of the nativescript package is done globally. This will ensure you can use its command line tool in any Visual Studio Code project. The name of this Command-Line tool is tns. Type the following command to have all details of this CLI:
> tns -h
During the installation there is a check for the Android SDK installation. You may receive these messages in the Command Prompt window:
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ android to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You have to install version 23.
Run android from your command-line to install required Android Build Tools.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ android to manage the Android Support Repository.
If you see one of these messages, go to the Android SDK installation section to solve this issue.