mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
Fixes #5392 When running `bun install` on a package.json with no dependencies, an empty `node_modules` folder was being created. This change adds checks in both hoisted and isolated install strategies to skip node_modules creation when there are no packages to install. The fix preserves node_modules creation when using filters like `--production` that may result in zero packages after filtering but had packages in the original lockfile. Changes: - Check both filtered and original dependency counts in hoisted install - Check both store entries and lockfile packages in isolated install - Return early with empty Summary if truly no dependencies - Add regression test that verifies no node_modules created when empty 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>