Skip to content

fix(deps): add missing ci-info dependency#4263

Merged
JamesHenry merged 3 commits intolerna:mainfrom
mhassan1:ci-info-dep
Mar 10, 2026
Merged

fix(deps): add missing ci-info dependency#4263
JamesHenry merged 3 commits intolerna:mainfrom
mhassan1:ci-info-dep

Conversation

@mhassan1
Copy link
Copy Markdown
Contributor

Description

In d51e344, we added code that uses the ci-info package, but we did not add a dependency on ci-info to package.json; as a result, strict environments (e.g. Yarn Plug'n'Play) show an error like this:

Error: lerna tried to access ci-info, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Motivation and Context

See above.

How Has This Been Tested?

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (change that has absolutely no effect on users)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@oscarmarina
Copy link
Copy Markdown

Hi,

I've been testing the new npm install-strategy = "linked" and Lerna fails consistently because it attempts to require('ci-info') in libs/core/src/lib/oidc.ts. Since it's not explicitly declared in Lerna's dependencies, the "linked" strategy (which is very strict with phantom dependencies) blocks access to it.

Example/Reproduction Branch:

Note: In this branch, I've had to manually add ci-info to my root package.json as a workaround to keep the CI running. If I remove that line, Lerna immediately fails with the following trace:

Error: Cannot find module 'ci-info'
Require stack:

 .../node_modules/lerna/dist/index.js
 .../node_modules/lerna/dist/cli.js
    at libs/core/src/lib/oidc.ts (.../node_modules/lerna/dist/index.js:5703:30)

Thanks for the fix!

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Mar 10, 2026

View your CI Pipeline Execution ↗ for commit d47edcf

Command Status Duration Result
nx run-many --t e2e --parallel=1 ✅ Succeeded 55s View ↗
nx run-many -t build --parallel=3 ✅ Succeeded 15s View ↗
nx run-many -t lint --parallel=3 ✅ Succeeded 11s View ↗
nx run-many -t test --parallel=3 --ci --maxWork... ✅ Succeeded 10s View ↗
nx run integration:integration --ci --maxWorkers=2 ✅ Succeeded 9s View ↗
nx-cloud record -- npx nx format:check ✅ Succeeded 2s View ↗
nx run-many -t test --parallel=3 --ci --maxWork... ✅ Succeeded 15s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-10 13:36:31 UTC

Copy link
Copy Markdown

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

Our e2e-repair test is failing due to a pre-existing snapshot mismatch that exists on the main branch. The snapshot needs to be updated to include the new Nx migration (22-7-0-add-polygraph-to-git-ignore), but this is unrelated to the ci-info dependency fix in this PR.

No code changes were suggested for this issue.

You can trigger a rerun by pushing an empty commit:

git commit --allow-empty -m "chore: trigger rerun"
git push

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@JamesHenry
Copy link
Copy Markdown
Member

I will fix the snapshot and sync up

@JamesHenry JamesHenry merged commit b768187 into lerna:main Mar 10, 2026
13 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.

3 participants