Switching a monorepo from nodeLinker: node-modules to pnpm aborts:
➤ · I/O error (Operation not permitted (os error 1))
Repro (yarn 6.0.0-rc.18, bec529a):
# root package.json: workspaces ["packages/*"], deps { no-deps: 1.0.0 }
# packages/pkg-a: deps { no-deps: 2.0.0 }
yarn config set nodeLinker node-modules && yarn install
yarn config set nodeLinker pnpm && yarn install
The version conflict leaves no-deps@2.0.0 as a real directory at packages/pkg-a/node_modules/no-deps. In link_project_pnpm the symlink pass calls fs_rm_file (unlink) on that path, which fails on a directory — EPERM on macOS, EISDIR on Linux — and ok_missing only swallows NotFound. fs_remove_nm clears the root node_modules but never the per-workspace ones.
Fix: use the directory-aware fs_rm at the symlink sites. PR to follow.
Switching a monorepo from
nodeLinker: node-modulestopnpmaborts:Repro (yarn 6.0.0-rc.18, bec529a):
The version conflict leaves
no-deps@2.0.0as a real directory atpackages/pkg-a/node_modules/no-deps. Inlink_project_pnpmthe symlink pass callsfs_rm_file(unlink) on that path, which fails on a directory — EPERM on macOS, EISDIR on Linux — andok_missingonly swallows NotFound.fs_remove_nmclears the rootnode_modulesbut never the per-workspace ones.Fix: use the directory-aware
fs_rmat the symlink sites. PR to follow.