A Teammates PR Broke Webpack: Node-Gyp Rebuild Failed. Where Do I Start?

buildjavascriptnpm3 replies · 313 views · started
  1. not gonna lie this is driving me nuts local build works, CI build fails. Classic. The CI log ends with:

    $ npm install

    $ npm install
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: my-dashboard@0.1.0
    npm ERR! Found: react@19.x
    npm ERR! node_modules/react
    npm ERR!   react@"^19" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"^17 || ^18" from some-chart-lib@x
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force or --legacy-peer-deps
    

    node-gyp rebuild failed. Its a webpack project with a fairly standard setup. I susepct a version difference between my machine and teh CI runner, but idk which version matters: Node, npm, or one of the packages. How do u track down this kind of mismatch? Any guidance on making local and CI builds behvae teh same would be great.

    1
  2. ok but is teh lockfile committed, and does CI use npm ci? ??

    1 8 helpful
  3. hmmm node-gyp failures mean a native module needs compiling and there was no prebuilt binary for ur Node version or platform. Either install build tools (Python and a C++ compiler) or, better, use a Node version teh package supports. Also check case-sensitive import paths: macOS and Windows forgive ./Button vs ./button, Linux CI does not. worked for me anyway 🤷

    40 0 helpful

Reply to this topic

Sign in or create an account to reply.