portails/content/docs/help/how-to-update.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2020-12-03 16:07:04 +01:00
---
title: "How to Update"
description: "Regularly update the installed npm packages to keep your Doks website stable, usable, and secure."
lead: "Regularly update the installed npm packages to keep your Doks website stable, usable, and secure."
date: 2020-11-12T13:26:54+01:00
lastmod: 2020-11-12T13:26:54+01:00
draft: false
images: []
2021-04-02 20:01:29 +02:00
menu:
2020-12-03 16:07:04 +01:00
docs:
parent: "help"
weight: 610
toc: true
---
{{< alert icon="💡" text="Learn more about <a href=\"https://docs.npmjs.com/about-semantic-versioning\">semantic versioning</a> and <a href=\"https://docs.npmjs.com/cli/v6/using-npm/semver#advanced-range-syntax\">advanced range syntax</a>." />}}
2020-12-03 16:07:04 +01:00
2021-04-02 20:01:29 +02:00
## Check for outdated packages
2020-12-03 16:07:04 +01:00
2021-04-02 20:01:29 +02:00
The [`npm outdated`](https://docs.npmjs.com/cli/v7/commands/npm-outdated) command will check the registry to see if any (or, specific) installed packages are currently outdated:
2020-12-03 16:07:04 +01:00
```bash
2021-04-02 20:01:29 +02:00
npm outdated [[<@scope>/]<pkg> ...]
```
## Update packages
The [`npm update`](https://docs.npmjs.com/cli/v7/commands/npm-update) command will update all the packages listed to the latest version (specified by the tag config), respecting semver:
```bash
npm update [<pkg>...]
2020-12-03 16:07:04 +01:00
```