You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/stories/1.0-update.md
+41-15
Original file line number
Diff line number
Diff line change
@@ -23,32 +23,58 @@ If you prefer, you can also generate a new project in a separate folder using
23
23
24
24
## @angular/cli
25
25
26
-
Angular CLI can now be found on NPM under `@angular/cli` instead of `angular-cli`, and has a
27
-
minimum requirement of Node 6.9.0 or higher, together with NPM 3 or higher.
26
+
Angular CLI can now be found on NPM under `@angular/cli` instead of `angular-cli`, and upgrading is a simple 3 step process:
28
27
29
-
If you're using Angular CLI `beta.28` or less, you need to uninstall the `angular-cli` package.
28
+
1. Uninstall old version
29
+
2. Update node/npm if necessary
30
+
3. Install new version
31
+
32
+
### 1. Uninstall old version
33
+
34
+
If you're using Angular CLI `beta.28` or less, you need to uninstall the `angular-cli` packages:
30
35
```bash
31
-
npm uninstall -g angular-cli
32
-
npm uninstall --save-dev angular-cli
36
+
npm uninstall -g angular-cli# Remove global package
37
+
npm uninstall --save-dev angular-cli# Remove from package.json
33
38
```
34
39
35
-
To update Angular CLI to a new version, you must update both the global package and your project's
36
-
local package.
37
-
38
-
Global package:
40
+
Otherwise, uninstall the `@angular/cli` packages:
39
41
```bash
40
-
npm uninstall -g @angular/cli
42
+
npm uninstall -g @angular/cli # Remove global package
43
+
npm uninstall --save-dev @angular/cli # Remove from package.json
44
+
```
45
+
46
+
Also purge the cache and local packages:
47
+
```
48
+
rm -rf node_modules dist # Use rmdir on Windows
41
49
npm cache clean
42
-
npm install -g @angular/cli@latest
43
50
```
44
51
45
-
Local project package:
52
+
At this point, you should not have Angular CLI on your system anymore. If invoking Angular CLI at the commandline reveals that it still exists on your system, you will have to manually remove it. See _Manually removing residual Angular CLI_.
53
+
54
+
### 2. Update node/npm if necessary
55
+
56
+
Angular CLI now has a minimum requirement of Node 6.9.0 or higher, together with NPM 3 or higher.
57
+
58
+
If your Node or NPM versions do not meet these requirements, please refer to [the documentation](https://docs.npmjs.com/getting-started/installing-node) on how to upgrade.
59
+
60
+
### 3. Install the new version
61
+
62
+
To update Angular CLI to a new version, you must update both the global package and your project's local package:
63
+
46
64
```bash
47
-
rm -rf node_modules dist # use rmdir on Windows
48
-
npm install --save-dev @angular/cli@latest
49
-
npm install
65
+
npm install -g @angular/cli@latest # Global package
66
+
npm install --save-dev @angular/cli@latest# Local package
67
+
npm install# Restore removed dependencies
50
68
```
51
69
70
+
### Manually removing residual Angular CLI
71
+
72
+
If you accidentally updated NPM before removing the old Angular CLI, you may find that uninstalling the package using `npm uninstall` is proving fruitless. This _could_ be because the global install (and uninstall) path changed between versions of npm from `/usr/local/lib` to `/usr/lib`, and hence, no longer searches through the old directory. In this case you'll have to remove it manually:
73
+
74
+
`rm -rf /usr/local/lib/node_modules/@angular/cli`
75
+
76
+
If the old Angular CLI package _still_ persists, you'll need to research how to remove it before proceeding with the upgrade.
77
+
52
78
## .angular-cli.json
53
79
54
80
`angular-cli.json` is now `.angular-cli.json`, but we still accept the old config file name.
0 commit comments