govuk-frontend
govuk-frontend copied to clipboard
Improve installation of the right version of Node
What
Improve how we co-ordinate the version of Node that's needed to run the project across both our machines and CI. In a perfect world:
- There'd be a single source of truth (
package.json?) - A package update that needs a newer version would make CI fail (rather than pass at the moment because we install the latest
22) - Developers with a lower minor version than needed would be required to update on their machine
- The process would work both with
nvmandasdf
Why
We're using a .nvmrc file with only 22. Seems we need at least 22.12 due to some ESM packages being required. The latests minor version of Node 22 will be installed on CI, so things will work fine. However, on people's machine they may already have Node 22.11 installed, which satisfies the 22 in .nvmrc.
On top of that, we track the minimum Node version in the engines field of our repository's package.json (along with some of the packages in the repository as well, I think). It'd be great to
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
- [ ] We've investigated what different configurations of
.nvmrcandpackage.jsonallow in regards to the criteria in the decription - [ ] We're picked and implemented the best option