[BUG] Plugin install fails with EINVAL: invalid argument, rename - directory moved into itself
Resolved 💬 6 comments Opened Dec 9, 2025 by needsbuilder Closed Feb 22, 2026
Description
When installing the exa-mcp-server plugin via /plugin install exa-mcp-server, the installation fails with an EINVAL: invalid argument, rename error.
Steps to Reproduce
- Run
/plugin marketplace add exa-labs/exa-mcp-server - Run
/plugin install exa-mcp-server
Error Message
Error: Failed to install: EINVAL: invalid argument, rename
'/Users/<user>/.claude/plugins/cache/exa-mcp-server' ->
'/Users/<user>/.claude/plugins/cache/exa-mcp-server/exa-mcp-server/3.1.3'
Root Cause Analysis
The installation process attempts to rename/move the cache directory (exa-mcp-server) into a subdirectory of itself (exa-mcp-server/exa-mcp-server/3.1.3). This is an invalid filesystem operation - a directory cannot be moved into its own subdirectory.
Workaround Attempted
- Deleted the cache directory with
rm -rf ~/.claude/plugins/cache/exa-mcp-server - Re-ran the install command
- Same error occurs (the installation recreates the directory first, then tries the invalid rename)
Environment
- OS: macOS (Darwin 25.1.0)
- Claude Code Version: Latest
- Plugin: exa-mcp-server v3.1.3
Expected Behavior
The plugin should install successfully without attempting to move a directory into itself.
Suggested Fix
The installation logic should either:
- Download to a temporary directory first, then move to the final location
- Create the versioned directory structure before downloading
- Avoid using the same base path for both cache and final installation
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗