Perpetual NativeScript Mac Installation Issues

712 Views Asked by At

I could really use someone's help on this as I have been troubleshooting this for a really long time now with no remediation.

The issue is simply installing the NativeScript CLI onto my OSX Yosemite Mac. I followed the steps according to NS' website (installing proper Node.JS version, downloaded Xcode 7.2 (due to OS constraints), installed JSDK, installed NS Sidekick, installed Android Studio w/ proper SDK along with every other required dependancy.

However, when I run "sudo npm i -g nativescript --unsafe-perm" (otherwise it will throw a EACCES error), I get the following log with it saying I missing all of these dependencies I know I have but it is claiming I don't.

The biggest kick is that while it still will say NativeScript successfully installed, whenever I run any tns command (like tns doctor), the bash command cannot be found.

I have made sure to follow the directions of adding NS to my path as well as my Android and Java SDKs. Here is the full log:

jsmbp:~ Js$ sudo npm i -g nativescript --unsafe-perm
Password:
/Users/Jmsquillaro/.npm-packages/bin/nativescript -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
/Users/Jmsquillaro/.npm-packages/bin/tns -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns

> [email protected] install /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents
> node install

[fsevents] Success: "/Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] postinstall /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript
> node postinstall.js

WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements

TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.

WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements

TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.

WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.

Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ sdkmanager to manage your Android SDK versions.

You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=26'.
Run $ sdkmanager from your command-line to install required Android Build Tools. In case you already have them installed, make sure ANDROID_HOME environment variable is set correctly.

You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ sdkmanager to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.

Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
You will not be able to build your projects for Android.
To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as
 described in http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements

There seem to be issues with your configuration.
? Do you want to visit the official documentation? No
? Do you want to run the setup script? No
Your components are up-to-date: 
nativescript,tns-core-modules,tns-android,tns-ios

Autocompletion is already enabled

Installation successful. You are good to go. Connect with us on http://twitter.com/NativeScript.

+ [email protected]
added 692 packages in 156.18s
jsmbp:~ Js$ tns doctor
-bash: tns: command not found

What can I do to fix this? npm also declares "rollbackFailedOptional" every time I try to reinstall after I uninstall it. Is npm caching a broken version and can I force it to do a genuine "reinstall?" It has been so frustrating as everything looks messed up and I really don't want to give up on NS. Let me know your thoughts and thank you!

1

There are 1 best solutions below

23
On BEST ANSWER

Begin by installing node.js correctly. I've you are having to you --unsafe-perm that means, the node.js installation is not done right. I suggest you install nvm using homebrew and then install node from that. Please refer to my solution in this post https://discourse.nativescript.org/t/not-installing-on-macos/3292/4