Skip to content

Commit 51796e2

Browse files
author
Ferran Llop
committed
Add advice about the recommended nodejs version of the project and a short explanation about nvm on main readme, chapter 4 and exercises readme
1 parent 90cb8ac commit 51796e2

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,39 @@ Find pre-generated **PDF** and **EPUB** as [build artifacts of the latest releas
5353

5454
> ⚠️ This project setup is now a bit old and thus, you may run into various issues when building this locally. We recommend to use node v10.22.1 and the latest version of Calibre if possible.
5555
56+
### About the nodejs version
57+
58+
As the recommended node version (v10.22.1) is a bit old now, is more than likely that you do not have it installed on your system. You can have multiple versions of nodejs installed on your system using [nvm](https://github.com/nvm-sh/nvm). Refer to that project to install it and then you will be able to:
59+
60+
- Install any node version that you need:
61+
```
62+
nvm install 10.22.1
63+
nvm install 20.2.0
64+
```
65+
- Then you will be able to switch between node versions:
66+
```
67+
nvm use 10.22.1
68+
node -v // will show v10.22.1
69+
nvm use 20.2.0
70+
node -v // will show v20.2.0
71+
```
72+
73+
As this project has a .nvmrc file you can call `nvm install` and `nvm use` without specifying the node version:
74+
```
75+
// being anywhere inside this project
76+
nvm install
77+
node -v // will show v10.22.1
78+
```
79+
80+
81+
### Complete sequence of commands
82+
83+
Considering the above about having nvm installed on your system, here is the complete sequence of commands to generate pdf and epub files by yourself:
84+
5685
```
5786
git clone https://github.com/MostlyAdequate/mostly-adequate-guide.git
5887
cd mostly-adequate-guide/
88+
nvm install
5989
npm install
6090
npm run setup
6191
npm run generate-pdf

ch04.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Should you prefer to do exercises directly in files using your own editor:
117117

118118
- clone the repository (`git clone git@github.com:MostlyAdequate/mostly-adequate-guide.git`)
119119
- go in the *exercises* section (`cd mostly-adequate-guide/exercises`)
120+
- be sure to be using the recommended node version v10.22.1 (e.g. `nvm install`). More on this in [the readme of the book](./README.md#about-the-nodejs-version)
120121
- install the necessary plumbing using [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (`npm install`)
121122
- complete answers by modifying the files named *exercise\_\** in the corresponding chapter's folder
122123
- run the correction with npm (e.g. `npm run ch04`)

exercises/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ your proposal can be verified by running:
3131
npm run ch04
3232
```
3333

34+
Remember to first install node dependencies being at the recommended node version of the project. More on this on [the main README of the project](../README.md#about-the-nodejs-version).
35+
3436
Alternatively, you can also have a peak at the corresponding solution file: in this case
3537
`solution_a.js`.
3638

0 commit comments

Comments
 (0)