Skip to content

Conversation

@bjnewman
Copy link
Contributor

Summary

When analyzing monorepos (e.g., LangChain.js), the root package.json may not have name or version fields. This causes the analyze command to crash with:

TypeError: Cannot read properties of undefined (reading 'length')
    at run (file:///...e18e-cli/lib/commands/analyze.js:86:68)

This PR adds fallback values ('unknown') consistent with how computeInfo() already handles this case (lines 34-35 in the same file).

Test plan

  • Existing tests pass (20/20)
  • Verified fix works on LangChain.js monorepo (no longer crashes)
  • Lint and format checks pass

When analyzing monorepos, the root package.json may not have name or
version fields, causing a crash in the analyze command. This adds
fallback values consistent with computeInfo().
name: packageFile.name,
version: packageFile.version,
name: packageFile.name || 'unknown',
version: packageFile.version || 'unknown',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably default it to a valid semantic version at least, maybe 0.0.0.

just in case in future we try parse the version

@bjnewman
Copy link
Contributor Author

Fixed - now defaults to 0.0.0 for valid semver. Thanks for the feedback!

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/e18e/cli/@e18e/cli@151

commit: 7410d5a

@43081j 43081j merged commit d9a6585 into e18e:main Jan 21, 2026
5 checks passed
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.

2 participants