[bug]: pnpm add @radix-ui/react-slot Fails with ERR_PNPM_VIRTUAL_STORE_DIR_MAX_LENGTH_DIFF #7077
Open
2 tasks done
Labels
bug
Something isn't working
Describe the bug
When attempting to install the Badge, Button, etc componets using pnpm the command fails with an exit code 1 and throws the error
ERR_PNPM_VIRTUAL_STORE_DIR_MAX_LENGTH_DIFF
.Even after running pnpm install as suggested, the error persists when attempting to add the package again.
The only way for users who get this error is installing the components manually and install
@radix-ui/react-slot
separately if needed.Why This Happens :
pnpm uses a virtual store (e.g., node_modules/.pnpm) to hard-link dependencies from a global store, optimizing disk space and installation speed.
The virtual-store-dir-max-length setting determines how long directory names can be in this structure. If this value changes after the virtual store is created, pnpm detects a mismatch and refuses to proceed, as it can’t guarantee compatibility with the existing structure.
Affected component/components
Badge, Button, etc
How to reproduce
pnpm install
pnpm dlx shadcn@latest add badge
or other components@radix-ui/react-slot
manually if giving error when installing a components using cli.Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: