DOCS: Add a note to CONTRIBUTING.md about the npm peer dep issue (#2474)

This commit is contained in:
David Walker
2026-02-05 07:24:24 -08:00
committed by GitHub
parent 796bef81b3
commit a16706a33b

View File

@@ -221,6 +221,12 @@ the following rules:
After running `npm install`, if you do not change anything in `package.json` and `package-lock.json` is still changed, you need to update `npm` to the latest version. After that, discard the changes in `package-lock.json`, delete the `node_modules` folder, and run `npm install` again.
### Lots of `peer: true` lines added in `package-lock.json`
npm version 11.6.2 has a bug that causes this. Unfortunately, this is the current LTS (stable) release as of this writing. Use a newer or older npm version, and re-run `npm install`.
See https://github.com/npm/cli/pull/8671 and https://github.com/npm/cli/issues/8690 for details.
### Unrelated failed Jest tests
Some Jest tests fail to run in Node versions older than v24. On those versions, these tests show a small difference between the expected value ("Snapshot") and the actual value ("Received"). You need to use Node v24+ to run these tests.