Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d5feee8

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

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/content/tutorial/index.ngdoc

+22
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,27 @@ 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+
To avoid surprizes, the versions of 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+
If, however, you want to update one or more dependencies, you can use the `npm update` command:
292+
293+
- When passed a package name (e.g. `npm update some-package`), it will update the specified package
294+
to the latest version permitted by its version range (as specified in `package.json`). For
295+
example, if `package.json` contains `"some-package": "1.2.x"`, it will be updated to the latest
296+
1.2.x version, but not to 1.3.x.
297+
298+
- When run without any arguments, `npm update` will update all packages listed as dependencies in
299+
`package.json` to the latest version permitted by their specified version range.
300+
301+
- Finally, you can request for a package to be updated to the latest version (regardless of its
302+
version range in `package.json`), by appending `@latest` to the package's name:
303+
`npm update some-package@latest`
304+
305+
285306
### Common Issues
286307

287308
<br />
@@ -336,5 +357,6 @@ Now that you have set up your local machine, let's get started with the tutorial
336357
[npm]: https://www.npmjs.com/
337358
[nvm]: https://github.com/creationix/nvm
338359
[nvm-windows]: https://github.com/coreybutler/nvm-windows
360+
[package-lock]: https://docs.npmjs.com/files/package-lock.json
339361
[protractor]: https://github.com/angular/protractor
340362
[selenium]: https://docs.seleniumhq.org/

0 commit comments

Comments
 (0)