GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Npm Dependency Installation Fails with `ERESOLVE unable to resolve dependency tree` · Issue #2448 · diffplug/spotless

Npm Dependency Installation Fails with ERESOLVE unable to resolve dependency tree #2448

New issue
Copy link
New issue
Copy link
Closed
#2449
Closed
Npm Dependency Installation Fails with ERESOLVE unable to resolve dependency tree#2448
#2449
Copy link

Description

@jGleitz
jGleitz
opened on Mar 14, 2025
Issue body actions

After we increase the version of prettier in our projects, developers sometimes cannot use spotless at all. They get lint errors on formatted files, informing them that the npm install failed:

There were 39 lint error(s), they must be fixed or suppressed.
  build/<path to SQL file>:LINE_UNDEFINED prettier-format(com.diffplug.spotless.npm.NpmProcessException) Running npm command 'NpmInstall in <project path>/build/spotless-prettier-node-modules-edd532637edcb6904b3d70deaa4ddaa0 [<project path>/.gradle/nodejs/node-v22.14.0-darwin-arm64/bin/npm install --no-audit --no-fund --prefer-offline]' failed with exit code: 1 

Reproducing the command spotless runs reveals the error by npm spotless is facing:

npm install error
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: prettier@undefined
npm error node_modules/prettier
npm error   dev prettier@"3.4.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer prettier@"^3.0.3" from [email protected]
npm error node_modules/prettier-plugin-sql
npm error   dev prettier-plugin-sql@"0.18.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error <user home>/.npm/_logs/2025-03-14T09_43_53_020Z-eresolve-report.txt
npm error A complete log of this run can be found in: <user home>/.npm/_logs/2025-03-14T09_43_53_020Z-debug-0.log

The root problem is that npm needs to update its package information, but doesn’t do that when --prefer-offline is set. Spotless already has logic for such a case, but the detection for when to apply that logic does not include this case, yet.

Activity

  1. jGleitz
    added a commit that references this issue on Mar 14, 2025

    fix: try online install after ERESOLVE (diffplug#2448)

    1e628a1
  2. nedtwigg
    closed this as completedin #2449on Mar 14, 2025
  3. nedtwigg
    added a commit that references this issue on Mar 14, 2025

    fix: try online install after ERESOLVE (#2449 fixes #2448)

    This issue will close once commit 557d983 is merged into the 'main' branch.
    557d983
  4. nedtwigg commented on Apr 8, 2025

    @nedtwigg
    nedtwigg
    on Apr 8, 2025
    Member
    More actions

    Published in plugin-gradle 7.0.3 and plugin-maven 2.44.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.