Skip to content

Commit 09766f1

Browse files
jonkoopsljharb
authored andcommitted
[Tests] fix CI install failures in after_install step
Strip `eslint-doc-generator` from `package.json` before install where it causes peer dependency conflicts. It is only used for doc generation, not for running tests. On Node < 6, its transitive dependency `pretty-format@30.4.0` introduced `npm:` aliases unsupported by npm 5. On Node 16+ with strict peer resolution, its `eslint >= 8.57.1` peer dep conflicts with the `eslint@7` installed by `after_install`, causing npm's ERESOLVE diagnostic printer to intermittently crash. Fixes #4007 Signed-off-by: Jon Koops <jonkoops@gmail.com>
1 parent 012ec39 commit 09766f1

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/eslint-8-.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ jobs:
9292

9393
steps:
9494
- uses: actions/checkout@v4
95+
- name: strip eslint-doc-generator to avoid peer conflicts
96+
if: ${{ matrix.typescript-eslint >= 6 }}
97+
run: echo "$(jq 'del(.devDependencies["eslint-doc-generator"])' package.json)" > package.json
9598
- uses: ljharb/actions/node/install@main
9699
name: 'nvm install ${{ matrix.node-version }} && npm install'
97100
with:

.github/workflows/node-minors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ jobs:
9595

9696
steps:
9797
- uses: actions/checkout@v4
98+
- name: strip eslint-doc-generator to avoid peer conflicts
99+
if: ${{ matrix.node-version < 6 || (matrix.node-version >= 16 && matrix.eslint >= 7) }}
100+
run: echo "$(jq 'del(.devDependencies["eslint-doc-generator"])' package.json)" > package.json
98101
- uses: ljharb/actions/node/install@main
99102
name: 'nvm install ${{ matrix.node-version }} && npm install'
100103
with:

0 commit comments

Comments
 (0)