Native Script on Ubuntu Install fails


I saw a lot about these issues for windows but I followed the instructions for installing on Ubuntu (17.04) and post-install-cli fails to run.
I followed the instructions. Installed node 7.10, hit all the dependencies.
Installed Android SDK, setup $ANDROID_HOME in my .bashrc and skipped setting up AVD’s because the instructions were windows only so that’s pretty useless to me.

I have no idea how to uninstall native script at this point because NPM can’t find it even tought it was auto-installed under /usr/lib/node_modules/nativescript

Required info:

Please provide the following version numbers that your issue occurs with:

CLI: 3.0.3
Cross-platform modules: This doesn’t exist in /usr/lib/node_modules/nativescript or /usr/lib/node_modules/npm
(check the ‘version’ attribute in the node_modules/tns-core-modules/package.json file in your project)
Runtime(s):Haven’t made it past the install
Plugin(s): Haven’t made it this far.


build-tools  emulator  extras  licenses  patcher  platforms  platform-tools  tools

Install crashes out. I uninstalled and re-installed with --log trace

sudo npm install nativescript -g --unsafe-perm --log trace

Gist of Results:

Saw instructions to re-run on a git-hub issue regarding windows. Error’s in gist.

sudo tns post-install-cli --log trace
sudo tns doctor --log trace

Gist of results:


I also just tried with the sdk as installed from android studio. No luck.


Anyone want to tell me why node isn’t finding my ANDROID_HOME? It works in the shell. I’ve tried having it in ~/.profile ~/.bashrc individuall and then i tried it in both. I verified that I can see the value as sudo as well yet every time it comes back undefined. I’m at the point where I’m just going to hardcode it into android-tools-info.js because this makes zero sense.


sudo needs to be “sudo -E” so it carriers over environment variables. I haven’t tested if putting the environment variables globally in /etc/environment but that may work as well.


I’m not 100% sure, but I think you need one of the 6.xx LTS versions of Node.js to make the CLI work.

I’m currently using 6.10, one of my coworkers used Node 7 and couldn’t make NS work.


I can confirm node 7 works. Been happily developing since I ran sudo with the -E