-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
To update all dependencies to the latest version _that's compatible with the version range specified in your `package.json`_: | ||
To update all dependencies to the latest version: | ||
|
||
```sh | ||
$ bun update | ||
``` | ||
|
||
## `--force` | ||
To update a specific dependency to the latest version: | ||
|
||
{% callout %} | ||
**Alias** — `-f` | ||
{% /callout %} | ||
```sh | ||
$ bun update [package] | ||
``` | ||
|
||
## `--latest` | ||
|
||
By default, `bun update` will update to the latest version of a dependency that satisfies the version range specified in your `package.json`. | ||
|
||
By default, Bun respects the version range defined in your package.json. To ignore this and update to the latest version, you can pass in the `force` flag. | ||
To update to the latest version, regardless of if it's compatible with the current version range, use the `--latest` flag: | ||
|
||
```sh | ||
$ bun update --force | ||
$ bun update --latest | ||
``` | ||
|
||
For example, with the following `package.json`: | ||
|
||
```json | ||
{ | ||
"dependencies": { | ||
"react": "^17.0.2" | ||
} | ||
} | ||
``` | ||
|
||
- `bun update` would update to a version that matches `17.x`. | ||
- `bun update --latest` would update to a version that matches `18.x` or later. |