You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] ENOENT on first run: cache directory not created before writing version file #11425
On first run, OpenCode fails with ENOENT: no such file or directory when trying to write to ~/.cache/opencode/version.
The issue is in packages/opencode/src/global/index.ts. The code creates directories for data, config, state, log, and bin, but does not create the cache directory:
This fails because the parent directory doesn't exist.
Error Message
ENOENT: no such file or directory, open '/Users/xxx/.cache/opencode/version'
path: "/Users/xxx/.cache/opencode/version",
syscall: "open",
errno: -2,
code: "ENOENT"
Bun v1.3.5 (macOS x64)
OpenCode version
1.1.47
Steps to reproduce
Fresh install OpenCode on a system where ~/.cache/opencode/ does not exist
Run opencode
Observe ENOENT error
Expected behavior
OpenCode should create the cache directory before attempting to write the version file.
Suggested fix
Add fs.mkdir(Global.Path.cache, { recursive: true }) to the directory creation block in packages/opencode/src/global/index.ts.
Activity
github-actions commentedon Apr 2, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.