Skip to content

fix: add missing cwd to runScript spawn#6

Open
Hugo-DL wants to merge 1 commit intosumansid:mainfrom
Hugo-DL:fix/runscript-cwd
Open

fix: add missing cwd to runScript spawn#6
Hugo-DL wants to merge 1 commit intosumansid:mainfrom
Hugo-DL:fix/runscript-cwd

Conversation

@Hugo-DL
Copy link
Copy Markdown

@Hugo-DL Hugo-DL commented Mar 23, 2026

Fixes #5

Problem

npx openutter join fails with ERR_MODULE_NOT_FOUND: Cannot find package 'tsx' when run from any directory that does not have tsx in its node_modules.

Root Cause

runScript() spawns Node with --import tsx but does not set cwd: pkgRoot. Node resolves tsx relative to the current working directory instead of the package root where tsx is actually installed.

Fix

One-line change: add cwd: pkgRoot to the spawnSync options in runScript(), consistent with runNodeCommand() and runPlaywrightCommand() which already set this.

Testing

Before fix:

cd /tmp && npx openutter join https://meet.google.com/abc --anon --bot-name "Bot"
# → ERR_MODULE_NOT_FOUND: Cannot find package 'tsx'

After fix:

cd /tmp && npx openutter join https://meet.google.com/abc --anon --bot-name "Bot"
# → Works correctly (tsx resolved from package node_modules)

runScript() spawns Node with '--import tsx' but did not set cwd,
causing tsx resolution to fail when npx openutter is run from a
directory without tsx in its node_modules.

Other spawn helpers (runNodeCommand, runPlaywrightCommand) already
set cwd: pkgRoot. This aligns runScript with that pattern.

Fixes sumansid#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: runScript missing cwd causes tsx resolution failure

1 participant