Skip to content

pnpm hangs when encountering a cyclical aliased peer dependency #11999

Description

@isaacs

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

No response

Which area(s) of pnpm are affected? (leave empty if unsure)

Dependencies resolver

Link to the code that reproduces this issue or a replay of the bug

nuxt/nuxt#35196

Reproduction steps

Installing nuxt-nightly@5x aliased to the nuxt name fails to install properly in pnpm, resulting in a permanent hang due to a cyclical peer dependency.

mkdir nuxt-pnpm-hang
cd nuxt-pnpm-hang
echo {} > package.json
ppm i nuxt@npm:nuxt-nightly@5x

Describe the Bug

  1. nuxt-nightly@5.0.0-... depends on "@nuxt/nitro-server": "npm:@nuxt/nitro-server-nightly@<exact same version>".
  2. @nuxt/nitro-server-nightly declares "peerDependencies": { "nuxt": "npm:nuxt-nightly@<exact same version>" }. This is a self-referencing aliased peer dep that loops back to the top-level dependency being installed.
  3. pnpm's peer-dependency resolver deadlocks on this cycle: process goes to 0% CPU, no open sockets, threads parked in kevent/uv_cond_wait. Resolution shows resolved 498, reused 0, downloaded 417, added 0, then hangs forever.

Expected Behavior

Should resolve the package tree properly.

Which Node.js version are you using?

26.0.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions