Skip to content

Amaster-eu/Install-NativeScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Installation Steps:

  1. Install Homebrew
  2. Install last Ruby
  3. Install NodeJS
  4. Install Command Line Tools for Xcode
  5. Install Xcodeproj
  6. Install CocoaPods
  7. Install Java Platform (JDK)
  8. Install Android Studio
  9. Configuring Android Studio
  10. Install NativeScript CLI

We have in the beginning:

  • June 2018
  • Hight Sierra 10.13.5
  • Xcode need to update to 9.4.1 (12.89 GB), download here: developer.apple.com

1. Install Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

If problems
Error: Could not link: /usr/local/path
Solution:
rm -rf /usr/local/**path**
brew update

Checking: brew -v. Result: Homebrew 1.6.9

2. Install last Ruby

Checking: ruby -v. Result: ruby 2.3.3p222 -- default in 10.13.5 High Sierra

2.5.1 (Recommended) -> gorails.com/setup

  • brew install rbenv ruby-build

If problems
Error: Another active Homebrew process is already in progress.
Solution: sudo chown -R "$USER":your-name /usr/local/var/homebrew

  • Add rbenv to bash so that it loads every time you open a terminal:

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

source ~/.bash_profile

Install Ruby:

rbenv install 2.5.1

rbenv global 2.5.1

Checking: ruby -v. Result: ruby 2.5.1p57 (2018-03-29 revision 63029)

3. Install NodeJS

Without indication sudo: brew install node

If problems
Error: /usr/local/Cellar is not writable.
Solution: sudo chown -R $(whoami) /usr/local/Cellar

Error: Another active Homebrew process is already in progress. Please wait for it to finish or terminate it to continue.
Solution: rm -rf /usr/local/var/homebrew/locks

Checking: node -v. Result: v10.5.0

Last version of NodeJS: 8.11.3 LTS | 10.5.0 Current, source: nodejs.org

Checking: npm -v. Result: 6.1.0

Attention:
Do not install NodeJS from the package from the official site! Use Brew to avoid the risk of getting confused in the dependencies and something will not "start".

4. Install Command Line Tools for Xcode

Download Command Line Tools (macOS 10.13) for Xcode 9.4.1 (192.5 MB) and install.

5. Install Xcodeproj

sudo gem install xcodeproj

6. Install CocoaPods

sudo gem install cocoapods

7. Install Java Platform (JDK)

Download the *.dmg package from the Oracle site. And install.

Result: jdk-10.0.1_osx-x64_bin.dmg (414.7 MB)

8. Install Android Studio

Download the Android Studio from the Android site. And install.

Result: Android Studio 3.1.3 for Mac (889.9 MB)

9. Configuring Android Studio

Go into the settings of the Android Studio shell and install additional SDK Platforms Android versions 23-27 from the section and SDK Build-tools version 27.0.3:

Android Studio -> Preferences... -> Appearance & Behavior -> System Settings -> Android SDK

as shown in the figures below.

preview

preview

Then enter:

echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile

echo "export ANDROID_HOME=$HOME/Library/Android/sdk" >> ~/.bash_profile

Thus, the .profile file will be created or added if it already exists.

Apply variables without rebooting bash:

export JAVA_HOME=$(/usr/libexec/java_home)

export ANDROID_HOME=$HOME/Library/Android/sdk

Check the variables:

echo $JAVA_HOME. Result: /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home

echo $ANDROID_HOME. Result: /Users/your-name/Library/Android/sdk

Be sure to execute the command:

sudo xcode-select -r

If problems
Error: Requirements check failed for JDK 1.8 or greater
The problem arose when deploying Ionic to Android
Solution: make changes in .bash_profile:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
export ANDROID_HOME=/Users/amaster/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
export PATH=$PATH:/opt/gradle/gradle-4.9/bin

10. Install NativeScript CLI

Without indication sudo: npm install nativescript -g

Restart the command prompt.

Verify the setup: tns doctor

Should be a positive result: No issues were detected


Additional material:


P.S. Remove NativeScript

sudo npm uninstall nativescript -g

About

Install NativeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published