From 331a48493dae5c7f3bec9b017cc6154f4a356126 Mon Sep 17 00:00:00 2001 From: mukesh51 Date: Thu, 15 Sep 2016 18:15:39 +0100 Subject: [PATCH 1/2] Update Pre-requisities and troubleshooting section Updated troubleshooting section to notify the "require" error, while invoking ng serve and modified pre-requisites section to update the order in which angular-cli version is checked. --- docs/1-install-and-setup.md | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/docs/1-install-and-setup.md b/docs/1-install-and-setup.md index 187056ae3..ad1344fa4 100644 --- a/docs/1-install-and-setup.md +++ b/docs/1-install-and-setup.md @@ -6,18 +6,10 @@ ### 0. Prerequisites -You need the Angular CLI, typings, and TypeScript 2.0. TypeScript 2.0 is required for AngularFire2. +Before you start installing AngularFire2, make sure you have correct version of angular-cli installed. +To verify run the command `ng -v` and ensure you see `angular-cli: 1.x.x-beta.x-webpack.x`. -```bash -npm install -g angular-cli@webpack -# or install locally -npm install angular-cli@webpack --save-dev -# make sure you have typings installed -npm install -g typings -npm install -g typescript@2.0.2 -``` - -Verify you have the correct version installed by running `ng -v` and ensuring that you see `angular-cli: 1.x.x-beta.x-webpack.x`. If not, you may need to do the following: +If not, you may need to do the following: ```bash # if you have the wrong cli version only @@ -27,6 +19,16 @@ npm uninstall -g angular-cli npm install -g angular-cli@webpack ``` +You need the Angular CLI (you already got above), typings, and TypeScript 2.0. TypeScript 2.0 is required for AngularFire2. + +```bash +npm install -g angular-cli@webpack +# or install locally +npm install angular-cli@webpack --save-dev +# make sure you have typings installed +npm install -g typings +npm install -g typescript@2.0.2 +``` ### 1. Create a new project @@ -153,7 +155,7 @@ And that's it! If it totally borke, file an issue and let us know. ### Troubleshooting -#### Cannot find namespace 'firebase'. +#### 1. Cannot find namespace 'firebase'. If you run into this error while trying to invoke `ng serve`, open `src/tsconfig.json` and add the "types" array as follows: @@ -172,3 +174,12 @@ If you run into this error while trying to invoke `ng serve`, open `src/tsconfig } } ``` + +#### 2. Cannot find name 'require'. + +If you run into this error while trying to invoke `ng serve`, open `src/typings.d.ts` and add the following two entries as follows: + +```bash +declare var require: any; +declare var module: any; +``` From e79951f0d9f45be5acb7598022316ee12cd92344 Mon Sep 17 00:00:00 2001 From: mukesh51 Date: Thu, 15 Sep 2016 19:49:27 +0100 Subject: [PATCH 2/2] Update Pre-requisities and troubleshooting section Updated the document as per David's comments. --- docs/1-install-and-setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/1-install-and-setup.md b/docs/1-install-and-setup.md index ad1344fa4..3f83a9fff 100644 --- a/docs/1-install-and-setup.md +++ b/docs/1-install-and-setup.md @@ -19,7 +19,7 @@ npm uninstall -g angular-cli npm install -g angular-cli@webpack ``` -You need the Angular CLI (you already got above), typings, and TypeScript 2.0. TypeScript 2.0 is required for AngularFire2. +You need the Angular CLI, typings, and TypeScript 2.0. TypeScript 2.0 is required for AngularFire2. ```bash npm install -g angular-cli@webpack @@ -175,7 +175,7 @@ If you run into this error while trying to invoke `ng serve`, open `src/tsconfig } ``` -#### 2. Cannot find name 'require'. +#### 2. Cannot find name 'require' (This is just a temporary workaround for the Angular CLI). If you run into this error while trying to invoke `ng serve`, open `src/typings.d.ts` and add the following two entries as follows: