1 | # Installing Angular CLI on Windows 10
|
2 |
|
3 | > There had been installation issues of `@angular/cli` on Windows 10 system. Most of the time these errors are related to Python dependencies and node-gyp.
|
4 |
|
5 | Something as below :
|
6 |
|
7 | ```bash
|
8 | execSync@1.0.2 install C:\Users\User\AppData\Roaming\npm\node_modules\angu
|
9 | lar-cli\node_modules\angular2-template-loader\node_modules\codecov\node_modules\
|
10 | execSync
|
11 | node install.js
|
12 |
|
13 | [execsync v1.0.2] Attempting to compile native extensions.
|
14 | { [Error: spawn node-gyp ENOENT]
|
15 | code: 'ENOENT',
|
16 | errno: 'ENOENT',
|
17 | syscall: 'spawn node-gyp',
|
18 | path: 'node-gyp',
|
19 | spawnargs: [ 'rebuild' ] }
|
20 | [execSync v1.0.2]
|
21 | Native code compile failed!!
|
22 | Will try to use win32 extension.
|
23 | npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie h
|
24 | ttps://nodesecurity.io/advisories/130
|
25 | npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher
|
26 | to avoid a RegExp DoS issue
|
27 | npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher
|
28 | to avoid a RegExp DoS issue
|
29 |
|
30 | node-zopfli@2.0.1 install C:\Users\User\AppData\Roaming\npm\node_modules\a
|
31 | ngular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli
|
32 | node-pre-gyp install --fallback-to-build
|
33 | .......................
|
34 | ```
|
35 |
|
36 | To resolve this issue, make sure you've upgraded to the latest version of **NPM** and try installing `@angular/cli` again. This seems to have worked on certain scenarios.
|
37 |
|
38 | If the above doesn't work then the below steps should help. Please ensure all the commands are executed as an **Administrator**.
|
39 |
|
40 | ## Steps:
|
41 |
|
42 | ### 1) Install `node-gyp` from [here](https://github.com/nodejs/node-gyp) using NPM
|
43 |
|
44 | ```bash
|
45 | npm install -g node-gyp
|
46 | ```
|
47 |
|
48 | ### 2) Install Windows build tools from [here](https://github.com/felixrieseberg/windows-build-tools) using NPM
|
49 |
|
50 | ```bash
|
51 | npm install --global windows-build-tools
|
52 | ```
|
53 |
|
54 | *This will also install Python
|
55 |
|
56 | ### 3) Install Angular CLI
|
57 |
|
58 | ```bash
|
59 | npm install -g @angular/cli
|
60 | ```
|
61 |
|
62 | This should install `@angular/cli` without errors.
|
63 |
|
64 | #### Post this installation, follow the installation [guide](https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md) to install AngularFire and everything should work as expected.
|
65 |
|
66 |
|
67 | ### Note:
|
68 |
|
69 | When you start your app using `ng serve` in the console, you might still see the below errors. Despite these errors, the application should work as expected and should be able to talk to Firebase.
|
70 |
|
71 | ```bash
|
72 | ERROR in [default] C:\angularFire2Test\node_modules\angularfire2\interfaces.d.ts:12:34
|
73 | Cannot find namespace 'firebase'.
|
74 |
|
75 | ERROR in [default] C:\angularFire2Test\src\typings.d.ts:6:12
|
76 | Subsequent variable declarations must have the same type. Variable 'require' must be of type 'NodeRequire',
|
77 | but here has type 'any'.
|
78 |
|
79 | ERROR in [default] C:\angularFire2Test\src\typings.d.ts:7:12
|
80 | Subsequent variable declarations must have the same type. Variable 'module' must be of type 'NodeModule',
|
81 | but here has type 'any'.
|
82 | ```
|