UNPKG

2.96 kBMarkdownView Raw
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
5Something as below :
6
7```bash
8execSync@1.0.2 install C:\Users\User\AppData\Roaming\npm\node_modules\angu
9lar-cli\node_modules\angular2-template-loader\node_modules\codecov\node_modules\
10execSync
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.
23npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie h
24ttps://nodesecurity.io/advisories/130
25npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher
26to avoid a RegExp DoS issue
27npm 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
31ngular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli
32 node-pre-gyp install --fallback-to-build
33.......................
34```
35
36To 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
38If 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
45npm 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
51npm install --global windows-build-tools
52```
53
54*This will also install Python
55
56### 3) Install Angular CLI
57
58```bash
59npm install -g @angular/cli
60```
61
62This 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
69When 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
72ERROR in [default] C:\angularFire2Test\node_modules\angularfire2\interfaces.d.ts:12:34
73Cannot find namespace 'firebase'.
74
75ERROR in [default] C:\angularFire2Test\src\typings.d.ts:6:12
76Subsequent variable declarations must have the same type. Variable 'require' must be of type 'NodeRequire',
77but here has type 'any'.
78
79ERROR in [default] C:\angularFire2Test\src\typings.d.ts:7:12
80Subsequent variable declarations must have the same type. Variable 'module' must be of type 'NodeModule',
81but here has type 'any'.
82```