Describe the bug
When ut install --from pnpm anchors at a non-root workspace (a package.json / pnpm-workspace.yaml that is not the repo root), deps get hoisted into the anchor's node_modules/. Nested workspace packages referenced by that anchor (e.g. ../../packages/foo) cannot resolve those hoisted deps — Node's module resolution walks up from the script location, and the anchor's node_modules/ is sideways, never traversed.
Same root cause manifests twice:
- Duplicate-package postinstall failure (
Cannot find module '@electron/get')
- Any declared dep of a nested workspace package fails to resolve (25+ TS2307 in our repo)
Reproduction
git clone https://github.com/elrrrrrrr/lobehub -b ut-ci-test
cd lobehub/apps/desktop
ut install --from pnpm # anchors at apps/desktop (7 workspaces)
Observed:
Error: Cannot find module '@electron/get'
at packages/electron-client-ipc/node_modules/electron/install.js:3
Layout:
apps/desktop/node_modules/electron@41.1.0 + apps/desktop/node_modules/@electron/get ✓
packages/electron-client-ipc/node_modules/electron@39.8.8 (nested due to version conflict)
packages/electron-client-ipc/node_modules/electron/node_modules/ contains only @types, no @electron/get
Node resolves upward from install.js → never reaches apps/desktop/node_modules/ (sideways).
Expected
For each nested workspace package, its declared deps must be reachable via Node's upward resolution. Three valid layouts:
- A. Nested:
packages/<x>/node_modules/<dep>/node_modules/<subdep>
- B. Co-located:
packages/<x>/node_modules/<dep>
- C. Symlink to hoisted copy (pnpm's
.pnpm/ approach)
utoo currently appears to dedupe to the anchor without checking reachability from nested packages.
Environment
- utoo
1.0.27
- ubuntu-24.04 (GitHub Actions) and macOS — both reproduce
- Node 24.x
Describe the bug
When
ut install --from pnpmanchors at a non-root workspace (apackage.json/pnpm-workspace.yamlthat is not the repo root), deps get hoisted into the anchor'snode_modules/. Nested workspace packages referenced by that anchor (e.g.../../packages/foo) cannot resolve those hoisted deps — Node's module resolution walks up from the script location, and the anchor'snode_modules/is sideways, never traversed.Same root cause manifests twice:
Cannot find module '@electron/get')Reproduction
Observed:
Layout:
apps/desktop/node_modules/electron@41.1.0+apps/desktop/node_modules/@electron/get✓packages/electron-client-ipc/node_modules/electron@39.8.8(nested due to version conflict)packages/electron-client-ipc/node_modules/electron/node_modules/contains only@types, no@electron/getNode resolves upward from
install.js→ never reachesapps/desktop/node_modules/(sideways).Expected
For each nested workspace package, its declared deps must be reachable via Node's upward resolution. Three valid layouts:
packages/<x>/node_modules/<dep>/node_modules/<subdep>packages/<x>/node_modules/<dep>.pnpm/approach)utoo currently appears to dedupe to the anchor without checking reachability from nested packages.
Environment
1.0.27