Skip to content

Commit 2ff8ff4

Browse files
committed
docs(tutorial): explain how to upgrade dependencies
Related: angular/angular-seed#439
1 parent 07e72ec commit 2ff8ff4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/content/tutorial/index.ngdoc

+29
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,33 @@ the application as a whole is executing correctly. It is very common to run E2E
282282
a new commit of changes to a remote repository.
283283

284284

285+
### Updating dependencies
286+
287+
In order to avoid surprizes, all dependencies listed in `package.json` are pinned to specific
288+
versions (this is what the [package-lock.json][package-lock] file is about). This ensures that the
289+
same version of a dependency is installed every time.
290+
291+
Since all dependencies are acquired via npm, you can use the same tool to easily update them as
292+
well (although you probably don't need to for the purpose of this tutorial). Simply run the
293+
preconfigured script:
294+
295+
```
296+
npm run update-deps
297+
```
298+
299+
This will update all packages to the latest version that satisfy their version ranges (as specified
300+
in `package.json`) and also copy the necessary files into `app/lib/`. For example, if `package.json`
301+
contains `"some-package": "1.2.x"`, it will be updated to the latest 1.2.x version (e.g. 1.2.99),
302+
but not to 1.3.x (e.g. 1.3.0).
303+
304+
If you want to update a dependency to a version newer than what the specificed range would permit,
305+
you can change the version range in `package.json` and then run `npm run update-deps` as usual.
306+
307+
<div class="alert alert-info">
308+
See [here][semver-ranges] for more info on the various version range formats.
309+
</div>
310+
311+
285312
### Common Issues
286313

287314
<br />
@@ -336,5 +363,7 @@ Now that you have set up your local machine, let's get started with the tutorial
336363
[npm]: https://www.npmjs.com/
337364
[nvm]: https://github.com/creationix/nvm
338365
[nvm-windows]: https://github.com/coreybutler/nvm-windows
366+
[package-lock]: https://docs.npmjs.com/files/package-lock.json
339367
[protractor]: https://github.com/angular/protractor
340368
[selenium]: https://docs.seleniumhq.org/
369+
[semver-ranges]: https://docs.npmjs.com/misc/semver#ranges

0 commit comments

Comments
 (0)