anomalyco / anomalyco/opencode

Error: EISDIR: illegal operation on a directory, lstat 'T:\opencode'

Open
#49,887 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.