Skip to content

Commit

Permalink
Stick to using npm@8 (not v9) for running tests.
Browse files Browse the repository at this point in the history
This should fix the following error in Node.js 12 using npm@9:

  ERROR: npm v9.1.1 is known not to run on Node.js v12.22.12. You'll need to
  upgrade to a newer Node.js version in order to use this version of npm. This
  version of npm supports the following node versions: `^14.17.0 || ^16.13.0 ||`
  `>=18.0.0`. You can find the latest version at https://nodejs.org/.

  ERROR:
  /opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/npm/lib/utils/exit-handler.js:22
    const hasLoadedNpm = npm?.config.loaded
                           ^
  SyntaxError: Unexpected token '.'
  • Loading branch information
benjamn committed Nov 14, 2022
1 parent af5eed2 commit 81a1429
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Use latest npm
run: npm install --global npm@latest
- name: Use npm v8
run: npm install --global npm@8
- run: npm ci
- run: npm run build --if-present
- run: npm test

0 comments on commit 81a1429

Please sign in to comment.