Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If GitHub Actions stops at npm ci with ERESOLVE unable to resolve dependency tree or Conflicting peer dependency, the failure is usually an incompatible package requirement—not a Cypress test failure. Read the complete npm report, align the packages and lockfile, then make Node, npm settings, and the CI install command match your local setup. Use --legacy-peer-deps only as a documented, tested compatibility bypass.

What an ERESOLVE error means

npm is refusing to construct a dependency tree that satisfies all declared peer-version ranges. The report normally identifies three useful facts:

  • the package requesting a peer dependency;
  • the package and version npm found in the tree; and
  • the peer range that the requesting package allows.

For example, a plugin might accept cypress versions in one range while your manifest or lockfile selects a version outside it. GitHub Actions exposes the problem during a clean install because npm ci reconstructs the tree from the committed lockfile; it does not act as a general conflict solver.

Cypress’s GitHub Action can install dependencies, cache package data, and run Cypress. It cannot make incompatible peer constraints compatible. Diagnose the first failing npm command before changing Cypress action inputs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

1. Read the complete npm report before changing anything

  1. Open the failed workflow log and expand the npm ci step.
  2. Record the package named after “Could not resolve dependency” or “peer,” the installed version, and the required range.
  3. Inspect package.json, the relevant entries in package-lock.json, and recent dependency updates.
  4. Run the same install locally with the repository’s supported Node and npm versions. Do not begin by deleting the lockfile, adding --force, or disabling peer checks.

A lockfile mismatch produces a different message, often saying that the package manifest and lockfile are out of sync. A Cypress binary error appears later or mentions the Cypress executable, not an npm peer range. Keeping these categories separate prevents an unrelated cache or browser change from hiding the real cause.

2. Align the incompatible versions

Find an overlapping peer range

Choose versions whose declared requirements overlap and that your project actually supports. You may need to upgrade the package requesting the peer, downgrade the peer package, or update both. Review changelogs and application compatibility rather than choosing the newest number automatically.

Regenerate the lockfile intentionally

After editing the manifest, use the project’s normal npm version and configuration to regenerate the lockfile. Review the dependency diff, run the Cypress suite locally, and commit both package.json and package-lock.json. Do not routinely remove a committed lockfile in CI; that sacrifices reproducibility and can select a different tree on every run.

npm documents that options affecting dependency-tree shape must be consistent when the lockfile is created and consumed. In particular, if the lockfile was generated with --legacy-peer-deps (or another tree-shaping option), npm ci must receive the same setting or it can fail even though the files are committed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Make GitHub Actions match the repository

Select a deliberate Node version, check out the code, install from the directory containing the intended lockfile, and then invoke the Cypress action. Adapt action versions and start commands to your repository; the version placeholders below are intentional.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
name: Cypress tests

on:
  push:
  pull_request:

jobs:
  e2e:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@<chosen-version>

      - uses: actions/setup-node@<chosen-version>
        with:
          node-version: '<project-supported-version>'
          cache: npm
          # For a monorepo, set this to the lockfile path, for example:
          # cache-dependency-path: apps/web/package-lock.json

      - run: npm ci
      - uses: cypress-io/github-action@v7
        with:
          # Add build/start options required by this repository.
          command: npx cypress run

GitHub recommends committing lockfiles and using setup-node for Node workflows. Its npm cache is based on lockfile data; in a monorepo, configure cache-dependency-path and set the install step’s working directory correctly.

Monorepo checklist

  • Put working-directory on the install and Cypress steps when the application is not at repository root.
  • Point cache-dependency-path at the lockfile that controls that workspace.
  • Confirm whether the repository uses npm workspaces, a nested package, or multiple independent lockfiles.
  • Do not let CI install from one directory while caching or committing a different lockfile.

4. Use legacy-peer-deps only deliberately

--legacy-peer-deps tells npm to ignore peer dependencies while constructing the tree. It can unblock an intentionally accepted combination, but it does not demonstrate runtime compatibility. A Cypress plugin may install successfully and still fail when APIs differ.

Use the bypass only when the team has tested the combination and recorded why it is safe. Make it reproducible by committing a project-level .npmrc:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
legacy-peer-deps=true

Alternatively, pass the same option to both the command that creates the lockfile and the CI command:

npm ci --legacy-peer-deps

Tell maintainers which package conflict the setting covers, what tests protect the workaround, and who owns removing it. Treat --force as an even less informative escape hatch; it suppresses safety checks without resolving the declared incompatibility.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

5. Keep caching separate from dependency resolution

Caching can speed up installs, but a stale cache is not the first explanation for an ERESOLVE peer-range failure. Cache npm’s package data and Cypress’s binary cache where appropriate. Cypress advises against caching node_modules directly because it bypasses package-manager integrity and reconstruction behavior and can contribute to binary-installation problems.

When investigating, temporarily use a clean runner or clear the relevant cache key only after verifying the manifest, lockfile, Node version, and npm settings. If a clean npm ci still reports the same peer range, the conflict is in the dependency declarations, not the cache.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Distinguish npm conflicts from a missing Cypress binary

The Cypress npm package uses a postinstall script to download its platform binary. If lifecycle scripts were skipped, or the binary cache is incomplete, the error may say that Cypress is not installed or that the executable is missing. That is a separate failure category from ERESOLVE.

  1. Check whether installation ran with scripts disabled, such as an environment setting that omits lifecycle scripts.
  2. Inspect the Cypress cache location reported by the command-line tool.
  3. If the required binary is absent, run npx cypress install in the same environment and rerun the test.
  4. Check proxy, certificate, and network restrictions if the binary download itself fails.

Do not add --legacy-peer-deps to fix a missing binary, and do not reinstall the binary to fix a peer-range error.

Troubleshooting common GitHub Actions failures

“npm ci works locally but fails in GitHub Actions”

Compare Node and npm versions first. Then compare the exact working directory, lockfile, environment variables, and project .npmrc. A developer may have a global npm configuration or an uncommitted lockfile change that CI does not have. Print versions in a temporary diagnostic step:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
node --version
npm --version
npm config get legacy-peer-deps
npm ci

“ERESOLVE unable to resolve dependency tree” after a package update

Identify the peer requester and required range in the report, then inspect the update’s lockfile diff. Reconcile versions and regenerate the lockfile with the supported npm configuration. Do not solve a newly introduced conflict by deleting the lockfile.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CI reports a lockfile/package.json mismatch

Run the install locally using the same Node and npm versions, commit the resulting lockfile, and rerun CI. In a monorepo, verify that the command runs where the intended lockfile lives.

The Cypress action starts but tests never run

Check the action’s build and start options, application readiness URL, browser availability, and the first command that failed. The official action supports npm, Yarn, and pnpm installation, but its configuration cannot repair an invalid dependency tree.

Tests fail after using legacy-peer-deps

Assume the bypass exposed a real compatibility issue. Test the installed versions together, then replace the bypass with a package-version alignment when possible. If the workaround must remain, pin its configuration and document the risk rather than silently retaining it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A practical decision framework

Approach Compatibility Reproducibility Risk and maintenance
Align package versions and regenerate the lockfile Declared peer ranges overlap Highest when manifest, lockfile, Node, and npm settings are committed Usually the lowest long-term burden
Use legacy-peer-deps Peer checks are bypassed; runtime compatibility remains your responsibility Reproducible only when the same setting creates and consumes the lockfile Requires tests, documentation, and a removal owner
Use --force Constraints are suppressed, not reconciled Harder to reason about Highest diagnostic and runtime risk; avoid as a routine fix

Or skip the browser setup

If your broader workflow also needs website screenshots for visual checks, documentation, or release artifacts, ScreenshotNeo provides a single HTTP request instead of maintaining browser-capture code. It accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response reports the result in X-Page-Verdict and X-Billed headers.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the API documentation at https://screenshotneo.com/docs/ and supply your own key:

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Verification checklist before merging

  • The npm report’s peer requester, installed version, and required range are understood.
  • Compatible package versions are recorded in the manifest and lockfile.
  • Local and CI use the same deliberate Node version and npm settings.
  • npm ci runs from the directory containing the intended lockfile.
  • Any legacy-peer-deps use is committed, tested, explained, and assigned an owner.
  • Cypress binary, browser, cache, and test failures have been diagnosed separately from npm resolution.

Frequently Asked Questions

Should I delete package-lock.json to fix ERESOLVE?

No. Regenerate it intentionally after aligning package versions, review the dependency diff, and commit the updated lockfile.

Can the Cypress GitHub Action fix peer dependency conflicts?

No. It can install, cache, and run Cypress, but npm must still resolve the application’s declared dependency constraints.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does npm ci need the same legacy-peer-deps setting?

That setting can change the dependency-tree shape used to create the lockfile. npm requires the corresponding setting when consuming that lockfile.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.