npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.49k stars 3.18k forks source link

[BUG] Infinite loop in npm install when trying to resolve dependencies. #6611

Closed calebbrown closed 6 months ago

calebbrown commented 1 year ago

Is there an existing issue for this?

This issue exists in the latest npm version

Current Behavior

Running npm install @trans.js/tps-guarantee-detail@1.0.11 goes into an infinite loop that never ends.

The following output is produced forever:

$ npm install @trans.js/tps-guarantee-detail@1.0.11
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @formily/antd@2.2.26
npm WARN Found: antd@4.24.10
npm WARN node_modules/antd
npm WARN   peer antd@"^4.23.0" from @trans.js/tps-guarantee-detail@1.0.11
npm WARN   node_modules/@trans.js/tps-guarantee-detail
npm WARN     @trans.js/tps-guarantee-detail@"1.0.11" from the root project
npm WARN   2 more (tui_web_core, @trans.js/v4)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer antd@"<=4.22.8" from @formily/antd@2.2.26
npm WARN node_modules/@formily/antd
npm WARN   @formily/antd@"^2.2.17" from tps_web_components@0.0.82
npm WARN   node_modules/tps_web_components
npm WARN   2 more (tui_web_core, @trans.js/v4)
npm WARN
npm WARN Conflicting peer dependency: antd@4.22.8
npm WARN node_modules/antd
npm WARN   peer antd@"<=4.22.8" from @formily/antd@2.2.26
npm WARN   node_modules/@formily/antd
npm WARN     @formily/antd@"^2.2.17" from tps_web_components@0.0.82
npm WARN     node_modules/tps_web_components
npm WARN     2 more (tui_web_core, @trans.js/v4)
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @formily/antd@2.2.26
npm WARN Found: antd@4.24.10
npm WARN node_modules/antd
npm WARN   peer antd@"^4.23.0" from @trans.js/tps-guarantee-detail@1.0.11
npm WARN   node_modules/@trans.js/tps-guarantee-detail
npm WARN     @trans.js/tps-guarantee-detail@"1.0.11" from the root project
npm WARN   2 more (tui_web_core, @trans.js/v4)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer antd@"<=4.22.8" from @formily/antd@2.2.26
npm WARN node_modules/@formily/antd
npm WARN   @formily/antd@"^2.2.17" from tps_web_components@0.0.82
npm WARN   node_modules/tps_web_components
npm WARN   2 more (tui_web_core, @trans.js/v4)
npm WARN 
npm WARN Conflicting peer dependency: antd@4.22.8
npm WARN node_modules/antd
npm WARN   peer antd@"<=4.22.8" from @formily/antd@2.2.26
npm WARN   node_modules/@formily/antd
npm WARN     @formily/antd@"^2.2.17" from tps_web_components@0.0.82
npm WARN     node_modules/tps_web_components
npm WARN     2 more (tui_web_core, @trans.js/v4)
npm WARN ERESOLVE overriding peer dependency
...
$ npm --version
9.6.7

Expected Behavior

Either the install completes successfully, on an error is returned indicating that the installation cannot be completed.

Steps To Reproduce

  1. Start a Compute instance in GCP running x86_64, Ubuntu 20.04.6
  2. Install Node and NPM: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt-get install -y nodejs
  3. Run npm install @trans.js/tps-guarantee-detail@1.0.11
  4. See infinite loop.

Environment

acomagu commented 1 year ago

I encountered similar situation.

In my case, the problematic package is @refinedev/antd.

milaninfy commented 6 months ago

Closing: this looks to be similar if not a duplicate of an existing issue, #7349. If you believe your instance is unique, please provide further clarifying details.