builder icon indicating copy to clipboard operation
builder copied to clipboard

Dependency conflict issue when running npm install in Builder Angular example project

Open dhruvesh9 opened this issue 1 year ago • 1 comments

Hi,

I cloned the Builder Angular example project (https://github.com/BuilderIO/builder/tree/main/examples/angular) to test it locally.

After running npm install, I encountered the following error: npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: builder-angular-example@undefined npm error Found: [email protected] npm error node_modules/zone.js npm error zone.js@"^0.14.8" from the root project npm error npm error Could not resolve dependency: npm error peer zone.js@"0.14.7" from @builder.io/[email protected] npm error node_modules/@builder.io/angular npm error @builder.io/angular@"^3.1.1-0" 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.

It seems like @builder.io/angular v3.1.1-0 requires [email protected], but the project installs [email protected], which causes a conflict.

Questions:

  1. Is @builder.io/angular version 3.1.1-0 incompatible with [email protected]?
  2. Should I try to install the dependencies using --force or --legacy-peer-deps, or is there a recommended fix for this issue?

To Reproduce:

  1. Clone the Builder Angular example project
  2. Run npm install

Expected behavior: Node modules should install successfully without dependency issues.

Additional context: My current environment details:

Node.js version: v22.9.0 npm version: 10.8.3 Angular CLI version: 18.2.5 OS: Windows 10 x64

`Angular CLI: 18.2.5 Node: 22.9.0 Package Manager: npm 10.8.3 OS: win32 x64

Angular: ... common, compiler, compiler-cli, core, elements, forms ... language-service, platform-browser, platform-browser-dynamic ... platform-server, router

Package Version

@angular-devkit/architect 0.1802.5 (cli-only) @angular-devkit/build-angular @angular-devkit/core 18.2.5 (cli-only) @angular-devkit/schematics 18.2.5 (cli-only) @angular/cli 18.2.5 (cli-only) @schematics/angular 18.2.5 (cli-only) rxjs 7.8.1 (cli-only) typescript zone.js `

Thanks in advance for your help!

dhruvesh9 avatar Sep 19 '24 11:09 dhruvesh9

I'm not sure what else I need to do besides manually test this solution, but I have created a pull request that makes the zone.js peer dependency more lenient.

https://github.com/BuilderIO/builder/pull/3615

jakehockey10 avatar Oct 08 '24 00:10 jakehockey10

Closed by #3615

samijaber avatar Jan 15 '25 14:01 samijaber

Released in 5.0.1 https://github.com/BuilderIO/builder/blob/main/packages/angular/CHANGELOG.md#501

samijaber avatar Jan 15 '25 14:01 samijaber