Installation of nativescript on Arch Linux


Installation of nativescript on any platform seems to be a little tricky solution.  Here are instructions on how to get nativescript working on Arch Linux.

1. Install java-jdk

Refer to these instructions to install your preferred jdk environment.  Note that nativescript requires Java 8.

After installing java, create JAVA_HOME environment variable and add bin to PATH.  Add these to your .bashrc or whichever shell you are using.

export JAVA_HOME=/usr/lib/jvm/default
export PATH=$PATH:$JAVA_HOME/bin

2. Install android studio

Install android studio from aur depending on your method of installation (I used packer).

3. Startup android studio

After installation, run android studio and go through the initial configuration wizard.

4. Install more packages from sdk manager

In android studio, open sdk manager and install SDK Platforms 22 (5.1 lollipop).

5. Add ANDROID_HOME environment variable

Create environment variable ANDROID_HOME and target it to your android sdk folder.  Also add to PATH some tools folders.

export ANDROID_HOME=~/Android/Sdk
export PATH=$PATH:$JAVA_HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools

Now you should be able to run command adb and android anywhere in the command line.

6. Open sdk manager from command line

Open sdk manager from command line with the command android.

Select from under tools android sdk build tools 22.0.1. Install all packages also preloaded (11 or so).

7. Install nodejs and npm

sudo pacman -S nodejs npm

Note: depending on version, npm may be omitted since it comes with nodejs.

8. Install nativescript

sudo npm install -g --unsafe-perm nativescript

Installation might say there are some issues like missing ANDROID_HOME variable.  Ignore these errors.

9. Run config test

Running command tns doctor you should see:

Your components are up-to-date.
No issues were detected.

Which means you are up and running to start nativescript development.

One thought on “Installation of nativescript on Arch Linux

Leave a Reply

Your email address will not be published. Required fields are marked *