8000 Added installation guide for NativeScript · saknarak/nativescript-vue@0a09ee4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a09ee4

Browse files
committed
Added installation guide for NativeScript
1 parent 71dbe15 commit 0a09ee4

File tree

4 files changed

+98
-12
lines changed

4 files changed

+98
-12
lines changed

docs/_toc.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
- [Introduction](/)
22
- <span>Development</span>
3-
- [Installation](/installation)
3+
- [Installation - NativeScript](/installation-nativescript)
4+
- [Installation - Vue Plugin](/installation-nativescript-vue)
45
- [Quick Start](/installation)
56
- <span>Elements</span>
67
- <small>Layout</small>

docs/index.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@
8282
debug: true,
8383

8484
nav: [
85-
{
86-
title: 'Docs',
87-
path: '/',
88-
},
8985
{
9086
title: 'Roadmap',
9187
path: 'https://trello.com/b/mOdP0SHD/nativescript-vue-roadmap',

docs/installation-nativescript.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Installing NativeScript
2+
3+
In order to get started you will have to install the NativeScript command-line interface.
4+
5+
## Install Node.js
6+
7+
The NativeScript CLI is built on Node.js, and as such you need to have Node.js installed to use NativeScript.
8+
9+
You can check if you have Node.js installed by opening up a terminal or command prompt on your development machine and executing
10+
11+
```command
12+
node --version
13+
```
14+
15+
If you get an error, head to https://nodejs.org/ and download and install the latest "LTS" (long-term support) version for your development machine.
16+
17+
<p class="tip">
18+
If you’re on macOS and use [Homebrew](https://brew.sh/), you can alternatively install the Node.js LTS release by running `brew update`, to download the latest available updates and then `brew install node@6` in your terminal.
19+
</p>
20+
21+
<p class="tip">
22+
The NativeScript CLI supports a wide variety of Node.js versions, so if you already have Node.js installed you should be good to go. If, by chance, you’re running an unsupported version, the `tns doctor command` we’ll run momentarily will flag the problem so you can upgrade.
23+
</p>
24+
25+
## Install the NativeScript CLI
26+
27+
Open your terminal or command prompt and execute the following command to install the NativeScript CLI from npm, which is Node.js’ package manager:
28+
29+
```command
30+
npm install -g nativescript
31+
```
32+
33+
<p class="tip">
34+
If you are on a *NIX based system and receive an EACCESS error, you probably have to run the previous command with `sudo`, that is `sudo npm install -g nativescript`
35+
</p>
36+
37+
After completing the setup you should have two commands available from your terminal or command prompt:
38+
- `tns` — which is short for Telerik NativeScript
39+
- `nativescript`
40+
41+
The two commands are equivalent, so we'll stick with the shorter `tns`.
42+
43+
You can verify the installation was successful by running `tns` in your terminal. You should see something like this:
44+
```terminal
45+
$ tns
46+
# NativeScript
47+
┌─────────┬─────────────────────────────────────────────────────────────────────┐
48+
│ Usage │ Synopsis │
49+
│ General │ $ tns <Command> [Command Parameters] [--command <Options>] │
50+
│ Alias │ $ nativescript <Command> [Command Parameters] [--command <Options>] │
51+
└─────────┴─────────────────────────────────────────────────────────────────────┘
52+
```
53+
54+
## Install iOS and Android requirements
55+
When you build with NativeScript you're building truly native iOS and Android apps, and as such, you need to set up each platform you intend to build for on your development machine. To ease the pain of installing all of these requirements manually, the NativeScript CLI provides quick-start scripts for Windows and macOS that handle the necessary setup for you automatically. Let's look at how the work.
56+
57+
<p class="tip">
58+
Setting up your machine for native development can be tricky, especially if you're new to mobile development. If you get stuck, or if you have questions while going through these instructions, the [NativeScript community forum](http://forum.nativescript.org) is a great place to get help.
59+
</p>
60+
61+
<p class="warning">
62+
If you’re not comfortable with a script automatically installing dependencies on your development machine, or if you’re on Linux, refer to one of the advanced setup guides below for details on manually installing NativeScript’s iOS and Android dependencies.
63+
[Advanced setup: Windows](http://docs.nativescript.org/start/ns-setup-win),
64+
[Advanced setup: macOS](http://docs.nativescript.org/start/ns-setup-os-x),
65+
[Advanced setup: Linux](http://docs.nativescript.org/start/ns-setup-linux)
66+
</p>
67+
68+
### Windows
69+
70+
If you’re on Windows, copy and paste the script below into your terminal or command prompt and press Enter:
71+
72+
```command
73+
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"
74+
```
75+
76+
During installation you may need to accept a User Account Control prompt to grant the script administrative privileges. Also, be aware that the script downloads and installs some big dependencies — so it’s common for the script to take a while to complete. When the script finishes, close and reopen your command prompt.
77+
78+
<p class="tip">
79+
On Windows systems you can only use the NativeScript CLI to develop Android apps. This is because the NativeScript CLI uses Xcode to build iOS apps, which is only available on the macOS operating system. If you’re interested in building iOS apps on Windows, you may want to try out the public preview of [NativeScript Sidekick](https://www.nativescript.org/nativescript-sidekick). NativeScript Sidekick provides robust tooling for NativeScript apps, including a service that performs iOS and Android builds in the cloud, removing the need to complete these system requirements, and allowing you to build for iOS on Windows.
80+
</p>
81+
82+
### macOS
83+
84+
If you’re on a Mac, copy and paste the script below into your terminal and press Enter:
85+
86+
```command
87+
ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
88+
```
89+
90+
Much like the Windows script, the macOS script needs administrative access to run some commands using *sudo*; therefore, you may need to provide your password several times during execution. The macOS script also may take some time to complete, as it’s installing the dependencies for both iOS and Android development. When the script finishes, close and restart your terminal.
91+
92+
## Verify the setup
93+
94+
Once you've finished installing NativeScript and its dependencies, run the `tns doctor` command, which will check for any issues with your installation.
95+
96+
If you see "No issues were detected" you are good to go!

docs/installation.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0