Skip to content

Commit

Permalink
ci: Add tests for latest Node.js, use npm 7 on Node.js 14
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Apr 4, 2023
1 parent c7923d3 commit 7854926
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [14.x, 16.x]
node-version: [14, 16, latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -23,6 +23,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- if: matrix.node-version == 14
run: npm install --global npm@7
- run: npm ci
- run: npm test
- run: npm run test:dist
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"typescript": "^5.0.3"
},
"engines": {
"node": ">= 14"
"node": ">= 14",
"npm": ">= 7"
}
}

1 comment on commit 7854926

@swarnadeepsaha
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm engine >=7 create an issue where npm >=6.14 <7.

To Reproduce

  • node 14 minimum requirements (npm is >=6.14) with engine-strict=true.
    https://nodejs.org/en/download/releases
  • Or install node 14 using the node version manager(nvm) tool with engine-strict=true.

npm install will fail with:

npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for yaml@2.3.0: wanted: {"node":">= 14","npm":">= 7"} (current: {"node":"14.20.0","npm":"6.14.17"})
npm ERR! notsup Not compatible with your version of node/npm: yaml@2.3.0
npm ERR! notsup Not compatible with your version of node/npm: yaml@2.3.0
npm ERR! notsup Required: {"node":">= 14","npm":">= 7"}
npm ERR! notsup Actual:   {"npm":"6.14.17","node":"14.20.0"}

Expected behavior
npm >= 6.14, not npm >= 7

Versions (please complete the following information):

  • Environment: [e.g. Node.js 14.7.0 or Chrome 87.0]: Node.js 14.20.0
  • yaml: [e.g. 1.10.0 or 2.0.0-2]: 2.3.0

Please sign in to comment.