UNPKG

1.67 kBMarkdownView Raw
1# yarn-upgrade-all
2
3This is a command line utility program to upgrade all the packages in your `package.json` to the latest version
4(potentially upgrading packages across major versions).
5
6
7## Installation
8
9```
10yarn global add yarn-upgrade-all
11```
12
13#### Installation locally
14
15```
16yarn add yarn-upgrade-all
17```
18
19Usage: `./node_modules/.bin/yarn-upgrade-all`
20
21#### Installation on Windows
22
23```
24npm install -g yarn-upgrade-all
25```
26
27:exclamation: Don't use `yarn` to install it on Windows because there is a bug: [yarnpkg/yarn#2224](https://github.com/yarnpkg/yarn/issues/2224).
28
29
30## Usage
31
32```
33cd <your-node-js-project>
34yarn-upgrade-all
35```
36
37Or upgrade global packages:
38
39```
40yarn-upgrade-all --global
41```
42
43
44## How does it work?
45
46For every package in `package.json`, run `yarn remove <package-name> && yarn add [--dev|--peer] <package-name>`.
47
48
49## Why not simply `yarn upgrade --latest` ?
50
51Most of the time `yarn upgrade --latest` works. But I did meet some cases when it didn't work. I am not sure of the reason, maybe it's yarn's bug.
52
53This library is very robust because it goes the hard way.
54
55
56## What if a package failed to install?
57
58In that case, that package will be skipped and an error message will be printed.
59
60You need to read the error message and manually install that package.
61
62It is the recommended flow. Because if a package failed to install, most of the time, you need to manually troubleshoot the issue and fix the issue.
63
64
65## Ingore some packages
66
67You can add the following to `package.json` file:
68
69```json
70...
71"yarn-upgrade-all": {
72 "ignore": [
73 "react"
74 ]
75}
76...
77```
78
79With configuration above, `yarn-upgrade-all` won't upgrade `react` for you.