Skip to content

Commit 0523bf8

Browse files
authored
Merge pull request #1628 from plone/fixyarninstallation2
Fix yarn installation
2 parents d840b77 + e6fb485 commit 0523bf8

File tree

3 files changed

+60
-43
lines changed

3 files changed

+60
-43
lines changed

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@
130130
"plone.restapi/performance",
131131
"plone.restapi/src",
132132
"volto/contributing/branch-policy.md",
133-
"volto/contributing/install-operating-system.md",
134-
"volto/contributing/install-nodejs.md",
133+
"volto/contributing/install-docker.md",
134+
"volto/contributing/install-git.md",
135135
"volto/contributing/install-make.md",
136+
"volto/contributing/install-nodejs.md",
137+
"volto/contributing/install-operating-system.md",
136138
]
137139

138140
suppress_warnings = [

docs/glossary.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,17 @@ mrs-developer
280280
As a byproduct of its update operations, it also automatically adjusts `jsconfig.json`, which is used by Volto to configure webpack aliases.
281281
282282
Yarn
283-
[Yarn](https://yarnpkg.com/) is a JavaScript package manager.
283+
[Yarn](https://yarnpkg.com/) is both a JavaScript package manager and project manager.
284+
285+
Corepack
286+
[Corepack](https://github.com/nodejs/corepack) is a zero-runtime-dependency Node.js script that acts as a bridge between Node.js projects and the package managers they are intended to be used with during development.
287+
In practical terms, Corepack lets you use {term}`Yarn`, {term}`npm`, and {term}`pnpm` without having to install them.
288+
289+
Corepack is distributed by default with all recent Node.js versions.
290+
Run `corepack enable` to install the required Yarn and pnpm binaries on your path.
291+
292+
Git
293+
[Git](https://git-scm.com/) is a free and open source distributed version control system.
284294
285295
Hydration
286296
After loading an HTML page generated with {term}`SSR` in the browser, React can populate the existing {term}`DOM` elements, and recreate and attach their coresponding components.

docs/install/create-project.md

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ myst:
1111
(create-a-project-label)=
1212

1313
# Create a project
14-
14+
1515
This chapter describes how you can create a web application project using Plone, with full control over development and deployment.
1616

1717
If instead you want to contribute to a Plone package, see {doc}`/contributing/index`.
@@ -64,6 +64,7 @@ To avoid RAM and disk swap limitations, we recommend either temporarily resizing
6464
- {term}`Yarn`
6565
- {term}`GNU make`
6666
- {term}`Docker`
67+
- {term}`Git`
6768

6869

6970
(install-prerequisites-python-label)=
@@ -134,48 +135,44 @@ For the `fish` shell, see [`nvm.fish`](https://github.com/jorgebucaran/nvm.fish)
134135

135136
(install-prerequisites-yeoman-label)=
136137

137-
#### Yeoman
138+
#### Yeoman and the Volto boilerplate generator
138139

139-
Install {term}`Yeoman`.
140+
Install {term}`Yeoman` and the Volto boilerplate generator.
140141

141142
```shell
142-
npm install -g yo
143+
npm install -g yo @plone/generator-volto
143144
```
144145

145146

146147
(install-prerequisites-yarn-label)=
147148

148-
#### Yarn 3
149+
#### Yarn
149150

150-
Install the latest Yarn 3 version (not the Classic 1.x one).
151+
Use {term}`Corepack` to enable Yarn, which was already installed with the {ref}`supported version of Node.js <install-packages-prerequisites-label>`.
151152

152153
1. Open a terminal and type:
153154

154155
```shell
155156
corepack enable
156157
```
157158

158-
2. Verify that Yarn v3.x.x is installed and activated.
159+
````{important}
160+
The preceding instructions will not work if you have used another package manager, such as Homebrew on macOS, to install Yarn.
161+
You can verify where you installed Yarn.
159162

160-
```shell
161-
yarn set version 3.x
162-
yarn -v
163-
```
164-
```console
165-
3.2.3
166-
```
163+
```shell
164+
which yarn
165+
# /opt/homebrew/bin/yarn
166+
```
167167

168-
If you see a version that is not v3.x.x, you can try deleting the {file}`yarn.lock` file, and installing again.
168+
If the console includes `homebrew` in the path, then you must uninstall it.
169169

170-
```shell
171-
rm yarn.lock
172-
corepack enable
173-
yarn set version 3.x
174-
yarn -v
175-
```
176-
```console
177-
3.2.3
178-
```
170+
```shell
171+
brew uninstall yarn
172+
```
173+
174+
Now the instructions to install Yarn should work.
175+
````
179176

180177

181178
(install-prerequisites-make-label)=
@@ -188,12 +185,20 @@ Install the latest Yarn 3 version (not the Classic 1.x one).
188185

189186
(install-prerequisites-docker-label)=
190187

191-
#### Install Docker
188+
#### Docker
192189

193190
```{include} ../volto/contributing/install-docker.md
194191
```
195192

196193

194+
(install-prerequisites-git-label)=
195+
196+
#### Git
197+
198+
```{include} ../volto/contributing/install-git.md
199+
```
200+
201+
197202
(install-packages-install-label)=
198203

199204
## Install Plone 6
@@ -234,7 +239,7 @@ Note that pip normalizes these names, so `plone.volto` and `plone-volto` are the
234239
% pipx run cookiecutter gh:collective/cookiecutter-plone-starter
235240
236241
237-
Cookiecutter Plone Starter
242+
Cookiecutter Plone Starter
238243
================================================================================
239244
240245
Sanity checks
@@ -249,46 +254,46 @@ Project details
249254
--------------------------------------------------------------------------------
250255
251256
[1/19] Project Title (Project Title): Plone Conference Website 2070
252-
[2/19] Project Description (A new project using Plone 6.):
253-
[3/19] Project Slug (Used for repository id) (plone-conference-website-2070):
254-
[4/19] Project URL (without protocol) (plone-conference-website-2070.example.com):
257+
[2/19] Project Description (A new project using Plone 6.):
258+
[3/19] Project Slug (Used for repository id) (plone-conference-website-2070):
259+
[4/19] Project URL (without protocol) (plone-conference-website-2070.example.com):
255260
[5/19] Author (Plone Foundation): Elli
256261
[6/19] Author E-mail ([email protected]): [email protected]
257-
[7/19] Python Package Name (plone_conference_website_2070):
258-
[8/19] Volto Addon Name (volto-plone-conference-website-2070):
262+
[7/19] Python Package Name (plone_conference_website_2070):
263+
[8/19] Volto Addon Name (volto-plone-conference-website-2070):
259264
[9/19] Choose a Python Test Framework
260265
1 - pytest
261266
2 - unittest
262-
Choose from [1/2] (1):
263-
[10/19] Plone Version (6.0.8):
267+
Choose from [1/2] (1):
268+
[10/19] Plone Version (6.0.8):
264269
[11/19] Should we use Volto Alpha Versions? (No): yes
265-
[12/19] Volto Version (18.0.0-alpha.1):
266-
[13/19] Volto Generator Version (8.0.0):
270+
[12/19] Volto Version (18.0.0-alpha.1):
271+
[13/19] Volto Generator Version (8.0.0):
267272
[14/19] Language
268273
1 - English
269274
2 - Deutsch
270275
3 - Español
271276
4 - Português (Brasil)
272277
5 - Nederlands
273278
6 - Suomi
274-
Choose from [1/2/3/4/5/6] (1):
279+
Choose from [1/2/3/4/5/6] (1):
275280
[15/19] GitHub Username or Organization (collective): ellizurigo
276281
[16/19] Container Registry
277282
1 - GitHub Container Registry
278283
2 - Docker Hub
279-
Choose from [1/2] (1):
284+
Choose from [1/2] (1):
280285
[17/19] Should we setup a caching server?
281286
1 - Yes
282287
2 - No
283288
Choose from [1/2] (1): 2
284289
[18/19] Add Ansible playbooks?
285290
1 - Yes
286291
2 - No
287-
Choose from [1/2] (1):
292+
Choose from [1/2] (1):
288293
[19/19] Add GitHub Action to Deploy this project?
289294
1 - Yes
290295
2 - No
291-
Choose from [1/2] (1):
296+
Choose from [1/2] (1):
292297
293298
Plone Conference Website 2070 generation
294299
--------------------------------------------------------------------------------
@@ -358,7 +363,7 @@ To fix this you could try to:
358363
1. loosen the range of package versions you've specified
359364
2. remove package versions to allow pip attempt to solve the dependency conflict
360365
361-
ERROR: ResolutionImpossible: for help visit
366+
ERROR: ResolutionImpossible: for help visit
362367
make[2]: *** [Makefile:112: build-dev] Error 1
363368
make[2]: Leaving directory '/home/username/projects/volto/plone-volto/backend'
364369
make[1]: *** [Makefile:46: install-backend] Error 2

0 commit comments

Comments
 (0)