anomalyco / anomalyco/opencode
Error: EISDIR: illegal operation on a directory, lstat 'T:\opencode'
Open
Nobody has claimed this yet.
2.0
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
ERROR (#1): Error: EISDIR: illegal operation on a directory, lstat 'T:\opencode'
git-bash windows 11
user@ROG-DUO-16 MINGW64 /d/Program Files (AI)/codenomad
$ dotenv --override -- opencode2
[11:13:53.701] ERROR (#1): Error: EISDIR: illegal operation on a directory, lstat 'T:\opencode'
user@ROG-DUO-16 MINGW64 /d/Program Files (AI)/codenomad
$ tsx temp.ts
true
undefined
user@ROG-DUO-16 MINGW64 /d/Program Files (AI)/codenomad
$ dotenv --override -- tsx temp.ts
true
undefined
.env
NODE_TLS_REJECT_UNAUTHORIZED=0
TMPDIR=T:/
TEMP=T:/
TMP=T:/
NEXT_CACHE_DIR=T:/tmp-next
temp.ts
import fs from "fs"
console.log(fs.lstatSync("T:\\opencode").isDirectory())
console.log(fs.mkdirSync("T:\\opencode", { recursive: true }))
call pnpm add -g opencode-ai
call pnpm add -g --allow-build=@opencode-ai/cli @opencode-ai/cli
in v1 opencode will work
in v2 opencode2 will throw error
T:/ is a ram disk
packages/core/src/global.ts
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
win11
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/core/src/global.ts and reproduce the error on Windows 11 using the provided TMPDIR, TEMP, and TMP settings on a ram disk. Compare the v2 opencode2 behavior with the working v1 command and verify that the directory path no longer triggers EISDIR during startup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100