[Bug] Running from source fails with ERR_MODULE_NOT_FOUND until npm run build
#1567
chouste
started this conversation in
Bug reports
Replies: 1 comment
|
Windows data point on current Node v20.16.0 (system): Node v22.23.2: same tree, still no So the missing- |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Running from a source checkout as documented fails on a clean clone: the launcher exits with
ERR_MODULE_NOT_FOUNDbecause the workspace packages have nodist/yet. Both the quickstart and the development guide stop atnpm ci, and neither mentionsnpm run build.Environment
main)git clone --depth 1, no prior install, no globalprime-agenton PATHSteps to reproduce
git clone https://github.com/PrimeIntellect-ai/prime-agent cd prime-agent npm ci ./prime-agent.sh --versionExpected
The launcher starts, per quickstart.md ("To run a source checkout instead, use Node.js 22.8.0 or newer:
npm ci/./prime-agent.sh") and development.md, which both end the setup atnpm ci.Actual
Root cause
prime-agent.shdefaults to runningpackages/coding-agent/src/cli.tsthroughtsx, so no build seems necessary. But the coding agent imports its siblings by bare specifier, andnpm cionly symlinks those workspaces intonode_modules/@earendil-works/. Resolution then goes through each sibling's manifest:packages/agent/package.json→"main": "./dist/index.js"packages/ai/package.json→"exports": { ".": { "import": "./dist/index.js" } }dist/does not exist untilnpm run buildruns, so the bare-specifier import fails even though the entry point itself is TypeScript source. The--distpath already checks for a missing bundle and prints "Run npm run build first", but the default tsx path needs the build too and gives no such hint.Suggested fix
Add the build step to both setup blocks:
Optionally, have the default path in
prime-agent.shcheck for a siblingdist/and print the same actionable message the--distbranch already has, instead of surfacing a raw Node resolution stack.Happy to open a PR for the two doc pages if that would be useful, following the vouching process in CONTRIBUTING.md.
All reactions