used docs.nativescript.org Use latest version for installation !!!
node -v
if not installed :
# On Ubuntu 22.04, we used the following command to install latest node
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
npm -v
if not installed :
sudo apt install npm
Download the Node.js source code or a pre-built installer for your platform (includes npm)
sudo apt-get install -y openjdk-21-jdk
java --version
javac --version
Configure the ANDROID_HOME environment variable for NativeScript to be able to find the Android SDK, and add the required tools to path.
Add the following lines to your shell profile, usually ~/.bash_profile or ~/.bashrc, or if you are using zsh then ~/.zshrc config file:
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
Install the NativeScript CLI globally:
npm install -g nativescript
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
# or for android only :
ns doctor android
# or for ios only :
ns doctor ios
Sometimes you need to install typescript in global :
npm install -g typescript
ns run android
ns preview
# This is possibility for android
ns preview android
# This is possibility for ios
ns preview ios