Skip to content

fix: catch missing package manager binary in PATH gracefully - #95

Merged
ai merged 4 commits into
browserslist:mainfrom
keshavagr025:fix/missing-pm-binary-error
Aug 27, 2026
Merged

ai merged 4 commits into
browserslist:mainfrom
keshavagr025:fix/missing-pm-binary-error

Conversation

@keshavagr025

Copy link
Copy Markdown
Contributor

Summary

Catches ENOENT (command not found) errors when attempting to execute lockfile-detected package manager commands (such as bun or pnpm) when they are missing from system PATH, throwing a clean BrowserslistUpdateError.

Problem & Fix

If a project repository contains a bun.lock or pnpm-lock.yaml file, but the machine running npx update-browserslist-db does not have bun or pnpm installed, Node crashes with an uncaught ENOENT stack trace.

Wrapping getLatestInfo execution in a try...catch handles ENOENT gracefully and displays a clear message to the user.

@ai

ai commented Aug 27, 2026

Copy link
Copy Markdown
Member

Seems like we need to add tests

@keshavagr025

Copy link
Copy Markdown
Contributor Author

@ai i can check and re-submit the PR

@ai

ai commented Aug 27, 2026

Copy link
Copy Markdown
Member

Don't worry,. I will do it by my own LLM

@ai
ai merged commit b107bef into browserslist:main Aug 27, 2026
0 of 7 checks passed
@keshavagr025

Copy link
Copy Markdown
Contributor Author

@ai I really enjoyed contributing to this project. I would love to continue contributing to browserslist and update-browserslist-db. Could you guide me on any other features, or roadmap items I can take up next?

@ai

ai commented Aug 27, 2026

Copy link
Copy Markdown
Member

These projects are in maintenance mode. There are not a lot of tasks to do.

@keshavagr025

Copy link
Copy Markdown
Contributor Author

@ai Ok, Thank You.

@ai

ai commented Aug 27, 2026

Copy link
Copy Markdown
Member

Seems like we had an error here:

My LLM found that we need also check the exitCode 6895267

And CI is falling because of the lack of tests 8bb8938

Be careful next time

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