Skip to content

fix: resolve npm install peer dependency issues#1476

Merged
muratkeremozcan merged 1 commit intobmad-code-org:mainfrom
jheyworth:fix/installer-peer-deps-comprehensive
Jan 30, 2026
Merged

fix: resolve npm install peer dependency issues#1476
muratkeremozcan merged 1 commit intobmad-code-org:mainfrom
jheyworth:fix/installer-peer-deps-comprehensive

Conversation

@jheyworth
Copy link
Copy Markdown
Contributor

Summary

Comprehensive fix for installer failures related to Astro/Starlight peer dependencies reported in v6.0.0-Beta.2.

Problem

Users experienced npm install failures with the error:

npm install fails → fs-extra never gets installed → BMB installer crashes

Investigation

After thorough testing, I found:

  • ✅ Starlight 0.37.x IS compatible with Astro 5.16.x (^5.5.0 includes 5.16.0)
  • ✅ npm install succeeds with current versions
  • ❌ However, npm shows peer dependency warnings that users interpret as failures
  • ❌ Module installer doesn't use --legacy-peer-deps for external modules

Solution

This PR implements a three-pronged fix:

1. Update Starlight to Latest (0.37.5)

  • Ensures we have latest bug fixes
  • Moves from 0.37.0 to 0.37.5
  • Still compatible with Astro 5.16.0

2. Add .npmrc Configuration

legacy-peer-deps=true
prefer-offline=true
  • Prevents peer dependency warnings during main package installation
  • Improves install reliability across different npm versions

3. Update Module Installer

  • Added --legacy-peer-deps flag to npm install commands in module manager
  • Prevents external module installation failures
  • Files: tools/cli/installers/lib/modules/manager.js (lines 419, 444)

Testing

  • ✅ npm install succeeds without warnings
  • ✅ Fresh install tested in clean environment
  • ✅ package-lock.json regenerated and verified
  • ✅ All dependencies resolve correctly
  • ✅ All test suites pass (52/52 schema tests, 12/12 install tests)
  • ✅ All linting and formatting checks pass

Impact

  • Resolves installation issues for all users
  • Works across npm versions (npm 7, 8, 9, 10)
  • Maintains backward compatibility
  • No breaking changes

Files Changed

  • package.json - Updated Starlight to 0.37.5
  • .npmrc - New file with legacy-peer-deps configuration
  • tools/cli/installers/lib/modules/manager.js - Added --legacy-peer-deps to npm install commands
  • package-lock.json - Regenerated with new Starlight version

🤖 Generated with Claude Code

Comprehensive fix for installer failures related to Astro/Starlight peer dependencies:

1. Update @astrojs/starlight from 0.37.0 to 0.37.5 (latest stable)
2. Add .npmrc with legacy-peer-deps to prevent peer dependency warnings
3. Update module installer to use --legacy-peer-deps flag for external modules

This resolves issues where:
- npm shows peer dependency warnings that users interpret as failures
- External module installations fail due to strict peer dependency checking
- Different npm versions handle peer dependencies inconsistently

Technical note: Starlight 0.37.x requires astro@^5.5.0, which is compatible
with astro@5.16.0 (^5.5.0 means >=5.5.0 <6.0.0). The issue was npm's warning
display, not actual incompatibility.

Fixes: Installation errors reported in v6.0.0-Beta.2

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Configuration and dependency updates to improve npm installation reliability. Changes include adding peer dependency handling and offline installation preferences to npm config, plus updating a starlight dependency version and adding installation flags to CLI commands.

Changes

Cohort / File(s) Summary
NPM Configuration
.npmrc
Removed registry URL and added legacy-peer-deps=true and prefer-offline=true options with inline documentation.
Dependency Updates
package.json
Updated @astrojs/starlight devDependency from ^0.37.0 to ^0.37.5.
Installation Command Updates
tools/cli/installers/lib/modules/manager.js
Added --legacy-peer-deps flag to two npm install invocations in the external module installation flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'fix: resolve npm install peer dependency issues' directly summarizes the main change: resolving npm install failures caused by peer dependency conflicts.
Description check ✅ Passed The pull request description is comprehensive and directly related to the changeset, clearly explaining the problem, investigation, solution, testing, and impact of the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv left a comment

Choose a reason for hiding this comment

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

Looks good to me. Wish I knew about --legacy-peer-deps two weeks ago :)

@muratkeremozcan muratkeremozcan merged commit 1c13305 into bmad-code-org:main Jan 30, 2026
7 checks passed
@jheyworth jheyworth deleted the fix/installer-peer-deps-comprehensive branch January 31, 2026 18:38
bmadcode pushed a commit that referenced this pull request Feb 1, 2026
### 🎁 Features
* Add generate-project-context workflow
* Shard market research customer analysis

### 🐛 Bug Fixes
* Fix npm install peer dependency issues (PR #1476)
* Fix leaked source paths in PRD validation report (#1481)
* Fix orphaned market research customer analysis (#1486)
* Fix duplicate 2-letter brainstorming code (BS → BSP)
* Fix tech writer sidecar functionality (#1487)
* Fix relative paths in workflow steps (#1497, #1498)
* Fix party-mode workflow file extension (#1499)
* Fix generated slash commands (#1501)
* Fix agent scan and help CSV files
* Fix HELP_STEP placeholder replacement (#1437)

### 📚 Documentation
* Add exact slash commands to Getting Started guide (#1505)
* Remove .claude/commands from version control (#1506)

### 🔧 Maintenance
* Update Starlight to 0.37.5
* Add GitHub issue templates
dickymoore pushed a commit to dickymoore/BMAD-METHOD that referenced this pull request Feb 6, 2026
### 🎁 Features
* Add generate-project-context workflow
* Shard market research customer analysis

### 🐛 Bug Fixes
* Fix npm install peer dependency issues (PR bmad-code-org#1476)
* Fix leaked source paths in PRD validation report (bmad-code-org#1481)
* Fix orphaned market research customer analysis (bmad-code-org#1486)
* Fix duplicate 2-letter brainstorming code (BS → BSP)
* Fix tech writer sidecar functionality (bmad-code-org#1487)
* Fix relative paths in workflow steps (bmad-code-org#1497, bmad-code-org#1498)
* Fix party-mode workflow file extension (bmad-code-org#1499)
* Fix generated slash commands (bmad-code-org#1501)
* Fix agent scan and help CSV files
* Fix HELP_STEP placeholder replacement (bmad-code-org#1437)

### 📚 Documentation
* Add exact slash commands to Getting Started guide (bmad-code-org#1505)
* Remove .claude/commands from version control (bmad-code-org#1506)

### 🔧 Maintenance
* Update Starlight to 0.37.5
* Add GitHub issue templates
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