NativeScript Advanced Setup: Windows
This page contains a guided walkthrough for installing NativeScript requirements and start building and running NativeScript apps on Windows.
Prerequisites
- Windows 7 Service Pack 1 or later
Setup Steps
Complete the following steps to set up NativeScript on your Windows development machine:
-
Install Chocolatey to simplify the installation and configuration of the requirements.
- Run the command prompt as an Administrator.
-
Copy and paste the following script in the command prompt.
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
- Restart the command prompt.
-
Install Google Chrome (required to debug NativeScript apps)
-
In the command prompt, run the following command.
choco install googlechrome -y
-
-
Install the latest Node.js LTS
-
In the command prompt, run the following command.
choco install nodejs-lts -y
-
-
Set up JDK 8
-
In the command prompt, run the following command.
choco install adoptopenjdk --version 8.192
-
-
Install the Android SDK.
-
In the command prompt, run the following command.
choco install android-sdk -y
Restart the command prompt.
-
-
Install all packages for the Android SDK Platform 28, Android SDK Build-Tools 28.0.3 or later, Android Support Repository, Google Repository and any other SDKs that you may need. You can alternatively use the following command, which will install all required packages.
"%ANDROID_HOME%\tools\bin\sdkmanager" "emulator" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository"
Setup Android Emulators (AVD) by following the article here
-
Install the NativeScript CLI.
-
Run the following command.
npm i -g nativescript
Restart the command prompt.
-
-
To check if your system is configured properly, run the following command.
tns doctor
If you see "No issues were detected" you are good to go!