Windsurf integration

NPM Conflicting Peer Dependencies in Windsurf Project

Running npm install in your Windsurf-generated project fails with ERESOLVE peer dependency conflict errors. Cascade added packages that require incompatible versions of shared dependencies, and npm cannot resolve a valid dependency tree.

This is one of the most frustrating issues in Node.js projects because it blocks all progress — you can't install any packages until the conflict is resolved. The error messages are dense and confusing, listing multiple packages and version ranges that seem impossible to untangle.

The problem typically appears after Cascade adds a new package, when upgrading an existing package, or when combining packages that Cascade recommended in different sessions without checking compatibility.

Error Messages You Might See

npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! Could not resolve dependency: peer react@"^17.0.0" from package@1.0.0 npm ERR! Conflicting peer dependency: react@17.0.2 npm ERR! Fix the upstream dependency conflict npm WARN overriding peer dependency
npm ERR! ERESOLVE unable to resolve dependency treenpm ERR! Could not resolve dependency: peer react@"^17.0.0" from package@1.0.0npm ERR! Conflicting peer dependency: react@17.0.2npm ERR! Fix the upstream dependency conflictnpm WARN overriding peer dependency

Common Causes

  • React version conflicts — One package requires React 17 while another requires React 18, or a package needs React as a peer dependency but the project uses a different version
  • Multiple UI library versions — Cascade installed both an old and new version of the same UI library (e.g., Material UI v4 and v5)
  • Outdated packages — Cascade recommended packages with peer dependencies pinned to old versions that conflict with your current stack
  • TypeScript version mismatch — Different packages require different TypeScript versions as peer dependencies
  • Using --legacy-peer-deps as a band-aid — Previous installs used --legacy-peer-deps to hide conflicts, creating an unstable node_modules that eventually breaks

How to Fix It

  1. Read the error carefully — npm's ERESOLVE error tells you exactly which packages conflict and what versions they need. Identify the root conflicting dependency
  2. Check if packages have compatible versions — Often updating one conflicting package to its latest version resolves the peer dependency conflict
  3. Use npm ls to inspect the tree — Run npm ls [package-name] to see which versions are installed and which packages depend on them
  4. Remove and reinstall — Delete node_modules and package-lock.json, then run npm install fresh. This often resolves phantom conflicts from corrupted lock files
  5. Use overrides for stubborn conflicts — Add an "overrides" field in package.json to force a specific version of the conflicting peer dependency
  6. Avoid --force and --legacy-peer-deps — These flags hide the problem but can cause runtime errors. Only use them as a last resort after understanding the implications

Real developers can help you.

Franck Plazanet Franck Plazanet I am a Strategic Engineering Leader with over 8 years of experience building high-availability enterprise systems and scaling high-performing technical teams. My focus is on bridging the gap between complex technology and business growth. Core Expertise: 🚀 Leadership: Managing and coaching teams of 15+ engineers, fostering a culture of accountability and continuous improvement. 🏗️ Architecture: Enterprise Core Systems, Multi-system Integration (ERP/API/ETL), and Core Database Structure. ☁️ Cloud & Scale: AWS Expert; architected systems handling 10B+ monthly requests and managing 100k+ SKUs. 📈 Business Impact: Aligning tech strategy with P&L goals to drive $70k+ in monthly recurring revenue. I thrive on "out-of-the-box" thinking to solve complex technical bottlenecks and am always looking for ways to use automation to improve business productivity. Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture David Olverson David Olverson Solo dev shipping production apps with AI-assisted development. I specialize in rescuing broken Lovable/Bolt/Cursor builds and taking them to production. 10+ apps shipped including SaaS CRMs, gaming platforms, real estate tools, and Discord bots. Stack: Next.js 16, TypeScript, Tailwind CSS, FastAPI, PostgreSQL, Prisma. I use Claude Code with 50+ custom skills for rapid delivery. Average turnaround: 2-4 weeks from broken prototype to production. Tejas Chokhawala Tejas Chokhawala Full-stack engineer with 5 years experience building production web apps using React, Next.js and TypeScript. Focused on performance, clean architecture and shipping fast. Experienced with Supabase/Postgres backends, Stripe billing, and building AI-assisted developer tools. Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. AUXLE AUXLE I am a Full Stack Developer experienced in building Websites, Web apps and Cross Platform Mobile Apps for Startups and Companies. Mehdi Ben Haddou Mehdi Ben Haddou - Founder of Chessigma (1M+ users) & many small projects - ex Founding Engineer @Uplane (YC F25) - ex Software Engineer @Amazon and @Booking.com ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Is it safe to use --legacy-peer-deps?

It's a temporary workaround, not a fix. --legacy-peer-deps tells npm to ignore peer dependency conflicts, which may cause runtime errors if the packages are truly incompatible. Use it only to unblock yourself while you find a proper resolution.

What are peer dependencies and why do they cause conflicts?

Peer dependencies are packages that a library expects YOU to install (like React for a React component library). Conflicts happen when two libraries expect different versions of the same peer dependency. Only one version can exist in your project.

Related Windsurf Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help