Skip to content

pnpm linker crashes on leftover workspace node_modules when switching from node-modules #304

Description

@jeckhart

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions