Getting Started
Setting up Windows for NativeScript
Setting up Windows for Android
You will need Node, a JDK (java development kit), Android Studio and the NativeScript CLI (command line interface).
Android Studio is not strictly necessary — however it provides an easy-to-use interface for installing and managing the Android SDKs.
We recommend using Chocolatey to install the required dependencies — a popular package manager for Windows.
Setting up the Android development environment can be daunting if you are new to Android development, however following the next steps carefully will get you up and running in no time.
Installing Node
To install Node we recommend using a node version manager, such as nvm-windows, nvs or any other node version manager you prefer. In these docs we will be using nvm-windows, but feel free to use a different node version manager.
- Follow the install instructions in the nvm-windows repository. We recommend using the installer, however if you have a more advanced understanding of your needs you may also go for the manual installation instead.
- Run and follow the
nvm-setup.exe
instructions. - Once the installation is complete, open a new Command Prompt and verify you can run
nvm ls
. - Install the latest Node release with:cli
nvm install node
- Verify the installation was successful and runcli
node -v npm -v
Troubleshooting
If any of the above failed, we recommend checking out the Microsoft Docs for Setting up Node, or asking in our Community Discord for assistance.
Installing a JDK
To install a JDK (using the prebuilt OpenJDK binaries from Adoptium) open an Administrator Command Prompt (right click and select "Run as Administrator") and run the following command:
choco install -y temurin17
Once installed, you might need to add it to your Path
. First, check if you need to add it to your Path
by opening a new Command Prompt and running the following:
javac --version
If you see a version number printed, you may skip this step. Otherwise, you will need to add the JDK binaries to your system environment Path
:
- Search for "Edit the system environment variables" in Windows Search and select
- Click on "Environment variables..." in the bottom corner
- Under the "User variables for..." select the Path variable and click Edit...
- Click New and add the JDK binaries folder path to the list. The default location is
C:\Program Files\Eclipse Adoptium\jdk-17.X.X\bin
Additionally, some installations may require creating the JAVA_HOME
environment variable manually:
- Search for "Edit the system environment variables" in Windows Search and select
- Click on "Environment variables..." in the bottom corner
- Click on New... under the "User variables for..." section
- Add the following variable. Ensure you're using the correct JDK path, without the \bin suffix. Example:
VARIABLE_NAME: JAVA_HOME VARIABLE_VALUE: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot
You may need to restart your terminal for changes to apply.
Installing Android Studio
Download and install Android Studio. In the installation wizard make sure you have the following components selected (the list should appear if you select custom options):
- Android SDK
- Android SDK Platform
- Android Virtual Device
- Performance (Intel ® HAXM) — optional, learn more about AMD Processor & Hyper-V support
The setup may take a while, but once it has finished a welcome screen should appear.
Android Studio installs the latest Android SDK by default, which in most cases should be all that's needed to build a NativeScript app.
Configuring ANDROID_HOME
and PATH
Configure the ANDROID_HOME
environment variable for NativeScript to be able to find the Android SDK.
- Search for "Edit the system environment variables" in Windows Search and select
- Click on "Environment variables..." in the bottom corner
- Under the "User variables for..." click on New... to create the
ANDROID_HOME
user variable that points to the path of the Android SDK:
The SDK is by default located at:
%LOCALAPPDATA%\Android\Sdk
To find the actual location in the Android Studio Settings, navigate to Appearance & Behavior › System Settings › Android SDK and copy the Android SDK Location.
Next, add Android platform-tools to path:
- Search for "Edit the system environment variables" in Windows Search and select
- Click on "Environment variables..." in the bottom corner
- Under the "User variables for..." select the Path variable and click Edit...
- Click New and add the platform-tools path to the list. The default location is inside the Android SDK's
platform-tools
folder:%LOCALAPPDATA%\Android\Sdk\platform-tools
Installing the NativeScript CLI
Install the NativeScript CLI globally:
npm install -g nativescript
You may see Deprecation and security warnings from npm, these are safe to ignore. Read more...
The NativeScript CLI relies on 3rd party packages that may have been deprecated over the past years. We are slowly replacing these dependencies with newer, supported alternatives to resolve these warnings, however they are generally safe to ignore, since the CLI is never exposed to the public and it's only used for local development, where most of the security concerns don't apply.
Verifying the environment
To verify that the installation was successful, open a new Command Prompt window (to ensure the new environment variables are loaded) and run:
ns doctor android
If you see No issues were detected then you have successfully set up your system.
Lastly, you will also want to set up an android device or emulator.
Troubleshooting
If any of the above failed, we recommend asking in our Community Discord for assistance.
Setting up Windows for iOS
❌ Unsupported
A Mac is required to build projects that use native iOS code. Simpler apps can be tested using NativeScript Preview.