Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for unsupported "engines" package.json fields #12638

Closed
wants to merge 0 commits into from

Conversation

colinrotherham
Copy link
Contributor

@colinrotherham colinrotherham commented Apr 8, 2024

Reopened from #11823 and closes #11868

Proposed changes

Follow up to #11793 to configure .npmrc with engine-strict=true and strict-peer-dependencies=true which will prevent Dependabot PRs from successfully completing pnpm install when package updates require Node.js > v18 etc

Rather than silently log warnings pnpm install will now prevent incompatible installs such as:

 WARN  Issues with peer dependencies found
packages/wdio-browser-runner
└─┬ modern-node-polyfills 1.0.0
  └── ✕ unmet peer esbuild@"^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0 || ^0.18.0": found 0.20.2

I've also added installed-checked as suggested by @voxpelli but ensured:

  1. The flag --fix is run to apply suggested changes
  2. Existing and suggested engines ranges use LTS versions as a minimum

## System Requirements
You’ll need [Node.js](http://nodejs.org) installed.
- Install at least v16.x or higher as this is the oldest active LTS version
- Only releases that are or will become an LTS release are officially supported

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@colinrotherham
Copy link
Contributor Author

Install error from Node.js 21 thrown during pnpm install now strict install checks are enabled

 ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)

Your Node version is incompatible with "/@serenity-js/core/3.21.2".

Expected version: ^16.13 || ^18.12 || ^20
Got: v21.7.2

This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.

@christian-bromann
Copy link
Member

@colinrotherham we are 2 weeks away from Node.js v22 release which we will then adopt in our pipelines. We could raise an issue in Serenity and ask for adding v21 to the engines parameter but I would almost suggest to either wait for 2 weeks and adopt v22 in our pipelines, or disable the v21 pipeline until we have support for v22.

@colinrotherham
Copy link
Contributor Author

@christian-bromann No rush in the slightest, this PR can wait for v22 changes

@christian-bromann christian-bromann added the Blocked Issues that are blocked due to certain circumstances label Apr 20, 2024
@christian-bromann
Copy link
Member

this PR can wait for v22 changes

Node.js v22 has just release, maybe we can give this another go ;-)

@colinrotherham
Copy link
Contributor Author

@christian-bromann Closed this by accident 🤦‍♂️

I had chance to try Node.js v22, but the new global WebSocket (nodejs/node#51594) isn't mocked by:

Probably a job for vi.stubGlobal() another day

@christian-bromann
Copy link
Member

Why would that matter in this context? I can't re-open the PR myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Issues that are blocked due to certain circumstances
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[💡 Feature]: Check for unsupported "engines" package.json fields
2 participants