Native Script on Ubuntu Install fails


#1

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.

ANDROID_HOME=/home/bryce/Software/AndroidSDK-NativeScript

$ls $ANDROID_HOME
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: https://gist.github.com/likwidoxigen/e484c6c400f0f02931a951cbe29985d7

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: https://gist.github.com/likwidoxigen/d4957c04ca8f2bf283ec61c6fb925f04


#2

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


#3

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.


#4

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.


#5

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.


#6

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