Skip to content

Commit 230ffa8

Browse files
committed
Inlining the installation instructions
1 parent d49c331 commit 230ffa8

File tree

2 files changed

+119
-18
lines changed

2 files changed

+119
-18
lines changed

index.html

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,29 +81,69 @@ <h3 id="prerequisites">Prerequisites</h3>
8181
<h2 id="getting-up-and-running">Getting up and running</h2>
8282
<p>In this chapter you&#39;re going to start with the basics, including installing the NativeScript CLI, starting a new project, and getting your first app up and running.</p>
8383
<h3 id="install-nativescript-and-configure-your-environment">Install NativeScript and configure your environment</h3>
84-
<p>The NativeScript CLI has a few system requirements you must have in place before building NativeScript apps. If you’re new to native mobile development, start with the NativeScript CLI’s quick setup scripts, which automatically install NativeScript and its dependencies on your development machine:</p>
84+
<p>The NativeScript CLI has a few system requirements you must have in place before building NativeScript apps. Let’s look at the steps you’ll need to take to get up and running.</p>
85+
<h4 class="exercise-start">
86+
<b>Exercise</b>: Setup NativeScript
87+
</h4>
88+
8589
<ul>
86-
<li><a href="http://docs.nativescript.org/start/quick-setup#quick-setup">Quick setup instructions</a></li>
87-
</ul>
88-
<p>If you have existing mobile experience, or if you want to control the installation process yourself, refer to the advanced setup instructions for your operating system:</p>
89-
<ul>
90-
<li><a href="http://docs.nativescript.org/start/ns-setup-win#setup">Advanced setup: Windows</a></li>
91-
<li><a href="http://docs.nativescript.org/start/ns-setup-os-x#setup">Advanced setup: OS X</a></li>
92-
<li><a href="http://docs.nativescript.org/start/ns-setup-linux#setup">Advanced setup: Linux</a></li>
90+
<li><strong>Step 1</strong>: Install Node.js.</li>
9391
</ul>
92+
<p>The NativeScript CLI is built on Node.js, and as such you need to have Node.js installed to use NativeScript.</p>
93+
<p>You can check whether you have Node.js installed by opening your terminal or command prompt and executing <code>node --version</code>. If you get an error, head to the <a href="https://nodejs.org/">https://nodejs.org/</a> and download and install the latest “LTS” distribution for your development machine.</p>
9494
<blockquote>
95-
<p><strong>TIP</strong>: Regardless of which approach you take, setting up your machine for native development can be tricky. If you get stuck, or if you have questions at any point while going through this guide, the <a href="http://developer.telerik.com/wp-login.php?action=slack-invitation">NativeScript Community Slack channel</a> is a great place to ask questions.</p>
95+
<p><strong>TIP</strong>: The NativeScript CLI supports a wide variety of Node.js versions, so if you already have Node.js installed you’re likely good to go. If, by chance, you are running an unsupported version, the <code>tns doctor</code> command we’ll run momentarily will flag the problem so you can upgrade.</p>
9696
</blockquote>
97-
<p>After completing the setup you should have two commands available from your terminal or command prompt: <code>tns</code>—which is short for <b>T</b>elerik <b>N</b>ative<b>S</b>cript—and <code>nativescript</code>. The two commands are equivalent, so we&#39;ll stick with the shorter <code>tns</code>.</p>
97+
<ul>
98+
<li><strong>Step 2</strong>: Install the NativeScript CLI</li>
99+
</ul>
100+
<p>Open your terminal or command prompt and execute the following command to install the NativeScript CLI from npm:</p>
101+
<pre><code>npm install -g nativescript
102+
</code></pre><p>After completing the setup you should have two commands available from your terminal or command prompt: <code>tns</code>—which is short for <b>T</b>elerik <b>N</b>ative<b>S</b>cript—and <code>nativescript</code>. The two commands are equivalent, so we&#39;ll stick with the shorter <code>tns</code>.</p>
98103
<p>You can verify the installation was successful by running <code>tns</code> in your terminal. You should see something like this:</p>
104+
<div class="no-copy-button"></div>
105+
99106
<pre><code>$ tns
100107
# NativeScript
101108
┌─────────┬─────────────────────────────────────────────────────────────────────┐
102109
│ Usage │ Synopsis │
103110
│ General │ $ tns &lt;Command&gt; [Command Parameters] [--command &lt;Options&gt;] │
104111
│ Alias │ $ nativescript &lt;Command&gt; [Command Parameters] [--command &lt;Options&gt;] │
105112
└─────────┴─────────────────────────────────────────────────────────────────────┘
106-
</code></pre><h3 id="start-your-app">Start your app</h3>
113+
</code></pre><ul>
114+
<li><strong>Step 3</strong>: Install iOS and Android requirements</li>
115+
</ul>
116+
<p>When you build with NativeScript you’re building truly native iOS and Android apps, and as such, you need to have the system requirements needed to build for each platform you intend to build for on your development machine.</p>
117+
<p>NativeScript provides two options for installing these requirements—quick setup scripts for developers new to mobile development, and advanced setup scripts for experienced mobile developers, as well as developers that want complete control over the installation process.</p>
118+
<ul>
119+
<li><strong>Step 3—Option A</strong>: Run quick setup scripts</li>
120+
</ul>
121+
<p>If you’re new to mobile development, and you’re on Windows or OS X, the NativeScript quick setup scripts are a great way to get up and running for NativeScript development.</p>
122+
<p>If you’re on Windows, copy and paste the script below into your command prompt and press Enter:</p>
123+
<pre><code>@powershell -NoProfile -ExecutionPolicy Bypass -Command &quot;iex ((new-object net.webclient).DownloadString(&#39;https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1&#39;))&quot;
124+
</code></pre><p>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.</p>
125+
<p>If you’re on a Mac, copy and paste the script below into your terminal and press Enter:</p>
126+
<pre><code>ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.rb)&quot;
127+
</code></pre><p>Much like the Windows script, the OS X script needs administrative access to run some commands using <code>sudo</code>; therefore, you may need to provide your password several times during execution. The OS X script also may take some time to complete, as it’s installing the dependencies for both iOS and Android development.</p>
128+
<ul>
129+
<li><strong>Step 3—Option B</strong>: Complete the advanced setup</li>
130+
</ul>
131+
<p>If you have existing mobile experience, or if you want to control the installation process yourself, refer to one of the advanced setup guide below, which walk you through manually setting up your environment for NativeScript development.</p>
132+
<ul>
133+
<li><a href="http://docs.nativescript.org/start/ns-setup-win#setup">Advanced setup: Windows</a></li>
134+
<li><a href="http://docs.nativescript.org/start/ns-setup-os-x#setup">Advanced setup: OS X</a></li>
135+
<li><a href="http://docs.nativescript.org/start/ns-setup-linux#setup">Advanced setup: Linux</a></li>
136+
</ul>
137+
<ul>
138+
<li><strong>Step 4</strong>: Verify the setup</li>
139+
</ul>
140+
<p>Once you’ve finished installing NativeScript and its dependencies, run the <code>tns doctor</code> command, which will check for any issues with your installation.</p>
141+
<pre><code>tns doctor
142+
</code></pre><p>If you see “No issues were detected” you’re good to go!</p>
143+
<div class="exercise-end"></div>
144+
145+
<p>Regardless of which approach you take, setting up your machine for native development can be tricky. If you get stuck, or if you have questions at any point while going through this guide, the <a href="http://developer.telerik.com/wp-login.php?action=slack-invitation">NativeScript Community Slack channel</a> is a great place to ask questions.</p>
146+
<h3 id="start-your-app">Start your app</h3>
107147
<p>With the NativeScript CLI installed, it&#39;s time to start building your app. Normally, you would <a href="https://github.com/NativeScript/NativeScript-cli#create-project">use the <code>tns create</code> command to create an empty NativeScript application</a>. For this guide however, we&#39;ve scaffolded out a boilerplate project to act as a starting point for <a href="https://github.com/NativeScript/sample-Groceries">Groceries</a>.</p>
108148
<h4 class="exercise-start">
109149
<b>Exercise</b>: Get the Groceries starting point

src/chapters/chapter1.md

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,34 @@ In this chapter you're going to start with the basics, including installing the
44

55
### Install NativeScript and configure your environment
66

7-
The NativeScript CLI has a few system requirements you must have in place before building NativeScript apps. If you’re new to native mobile development, start with the NativeScript CLI’s quick setup scripts, which automatically install NativeScript and its dependencies on your development machine:
7+
The NativeScript CLI has a few system requirements you must have in place before building NativeScript apps. Let’s look at the steps you’ll need to take to get up and running.
88

9-
* [Quick setup instructions](http://docs.nativescript.org/start/quick-setup#quick-setup)
9+
<h4 class="exercise-start">
10+
<b>Exercise</b>: Setup NativeScript
11+
</h4>
1012

11-
If you have existing mobile experience, or if you want to control the installation process yourself, refer to the advanced setup instructions for your operating system:
13+
* **Step 1**: Install Node.js.
1214

13-
* [Advanced setup: Windows](http://docs.nativescript.org/start/ns-setup-win#setup)
14-
* [Advanced setup: OS X](http://docs.nativescript.org/start/ns-setup-os-x#setup)
15-
* [Advanced setup: Linux](http://docs.nativescript.org/start/ns-setup-linux#setup)
15+
The NativeScript CLI is built on Node.js, and as such you need to have Node.js installed to use NativeScript.
16+
17+
You can check whether you have Node.js installed by opening your terminal or command prompt and executing `node --version`. If you get an error, head to the https://nodejs.org/ and download and install the latest “LTS” distribution for your development machine.
1618

17-
> **TIP**: Regardless of which approach you take, setting up your machine for native development can be tricky. If you get stuck, or if you have questions at any point while going through this guide, the [NativeScript Community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation) is a great place to ask questions.
19+
> **TIP**: The NativeScript CLI supports a wide variety of Node.js versions, so if you already have Node.js installed you’re likely good to go. If, by chance, you are running an unsupported version, the `tns doctor` command we’ll run momentarily will flag the problem so you can upgrade.
20+
21+
* **Step 2**: Install the NativeScript CLI
22+
23+
Open your terminal or command prompt and execute the following command to install the NativeScript CLI from npm:
24+
25+
```
26+
npm install -g nativescript
27+
```
1828

1929
After completing the setup you should have two commands available from your terminal or command prompt: `tns`—which is short for <b>T</b>elerik <b>N</b>ative<b>S</b>cript—and `nativescript`. The two commands are equivalent, so we'll stick with the shorter `tns`.
2030

2131
You can verify the installation was successful by running `tns` in your terminal. You should see something like this:
2232

33+
<div class="no-copy-button"></div>
34+
2335
```
2436
$ tns
2537
# NativeScript
@@ -30,6 +42,55 @@ $ tns
3042
└─────────┴─────────────────────────────────────────────────────────────────────┘
3143
```
3244

45+
* **Step 3**: Install iOS and Android requirements
46+
47+
When you build with NativeScript you’re building truly native iOS and Android apps, and as such, you need to have the system requirements needed to build for each platform you intend to build for on your development machine.
48+
49+
NativeScript provides two options for installing these requirements—quick setup scripts for developers new to mobile development, and advanced setup scripts for experienced mobile developers, as well as developers that want complete control over the installation process.
50+
51+
* **Step 3—Option A**: Run quick setup scripts
52+
53+
If you’re new to mobile development, and you’re on Windows or OS X, the NativeScript quick setup scripts are a great way to get up and running for NativeScript development.
54+
55+
If you’re on Windows, copy and paste the script below into your command prompt and press Enter:
56+
57+
```
58+
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
59+
```
60+
61+
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.
62+
63+
If you’re on a Mac, copy and paste the script below into your terminal and press Enter:
64+
65+
```
66+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.rb)"
67+
```
68+
69+
Much like the Windows script, the OS X script needs administrative access to run some commands using `sudo`; therefore, you may need to provide your password several times during execution. The OS X script also may take some time to complete, as it’s installing the dependencies for both iOS and Android development.
70+
71+
* **Step 3—Option B**: Complete the advanced setup
72+
73+
If you have existing mobile experience, or if you want to control the installation process yourself, refer to one of the advanced setup guide below, which walk you through manually setting up your environment for NativeScript development.
74+
75+
* [Advanced setup: Windows](http://docs.nativescript.org/start/ns-setup-win#setup)
76+
* [Advanced setup: OS X](http://docs.nativescript.org/start/ns-setup-os-x#setup)
77+
* [Advanced setup: Linux](http://docs.nativescript.org/start/ns-setup-linux#setup)
78+
79+
80+
* **Step 4**: Verify the setup
81+
82+
Once you’ve finished installing NativeScript and its dependencies, run the `tns doctor` command, which will check for any issues with your installation.
83+
84+
```
85+
tns doctor
86+
```
87+
88+
If you see “No issues were detected” you’re good to go!
89+
90+
<div class="exercise-end"></div>
91+
92+
Regardless of which approach you take, setting up your machine for native development can be tricky. If you get stuck, or if you have questions at any point while going through this guide, the [NativeScript Community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation) is a great place to ask questions.
93+
3394
### Start your app
3495

3596
With the NativeScript CLI installed, it's time to start building your app. Normally, you would [use the `tns create` command to create an empty NativeScript application](https://github.com/NativeScript/NativeScript-cli#create-project). For this guide however, we've scaffolded out a boilerplate project to act as a starting point for [Groceries](https://github.com/NativeScript/sample-Groceries).

0 commit comments

Comments
 (0)