You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(yarn) : migrated yarn to modern yarn berry (#842)
* chore(yarn): migrated yarn to modern yarn: version:[email protected]
* chore(package.json): add missing peer deps for cypress/coverage
* chore(github-actions): updated workflow with corepack to use modern yarn
* chore(ci.yml): update workflow to run on push & unauthorised file job to run on pull only
* chore(docs): Add docs for corepack for modern yarn
* Add corepack in deploy-preview
Copy file name to clipboardExpand all lines: README.md
+62
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,68 @@ cp .env.example .env
52
52
53
53
4. Ensure .env is in your .gitignore.
54
54
55
+
### Setup Corepack
56
+
57
+
This project uses modern Yarn ([email protected]), which requires Corepack for proper setup and management of package managers. Corepack is a tool that comes with Node.js 14.19.0 and later, allowing for consistent package manager versions across your project.
58
+
59
+
#### What is Corepack?
60
+
61
+
Corepack is an experimental tool to help with managing versions of your package managers. It exposes binary proxies for each supported package manager that, when called, will identify whatever package manager is configured for the current project, download it if needed, and finally run it.
62
+
63
+
64
+
#### Installing Corepack
65
+
66
+
If you're using Node.js version 14.19.0 or later, Corepack is included but might need to be enabled. For Node.js 16.10 or later, Corepack is available by default but might still need to be enabled.
67
+
68
+
To enable Corepack, run:
69
+
70
+
```bash
71
+
corepack enable
72
+
```
73
+
74
+
If you're using an older version of Node.js or if the above command doesn't work, you can install Corepack globally using npm:
75
+
76
+
```bash
77
+
npm install -g corepack
78
+
```
79
+
80
+
#### Using Corepack with This Project
81
+
82
+
Once Corepack is enabled or installed, it will automatically use the correct version of Yarn specified in the project's `package.json` file. You don't need to manually install Yarn.
83
+
84
+
To use Yarn commands, simply run them as usual:
85
+
86
+
```bash
87
+
yarn install
88
+
yarn run build
89
+
yarn run dev
90
+
```
91
+
92
+
Corepack will ensure that the correct version of Yarn is used for these commands.
93
+
94
+
#### Updating Yarn Version
95
+
96
+
If you need to update the Yarn version used in the project:
97
+
98
+
1. Update the `packageManager` field in `package.json`:
0 commit comments