cajias/claude-skills/cdk-multiple-lock-file-bundling
Claude Code and agent skill by cajias/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Fix AWS CDK bundling failures caused by multiple package lock files in the same project. Use when: (1) CDK synth/deploy fails with "ValidationError: Multiple package lock files found: pnpm-lock.yaml, package-lock.json", (2) NodejsFunction or other bundled Lambda fails during cdk synth, (3) CI pipeline fails on test stage with CDK bundling errors. Covers determining which lock file to keep based on project's actual package manager.
Install
npx vskill@latest install cajias/claude-skills/cdk-multiple-lock-file-bundlingSKILL.md
The same SKILL.md was published earlier as cajias/claude-skills/cdk-multiple-lock-file-bundling.
CDK Multiple Lock File Bundling Error
Problem
AWS CDK's NodejsFunction bundling fails when multiple package manager lock files exist in the repository. The error message doesn't indicate which package manager the project actually uses, requiring investigation.
Context / Trigger Conditions
- Error:
ValidationError: Multiple package lock files found: pnpm-lock.yaml, package-lock.json - Occurs during
cdk synth,cdk deploy, or test runs that synthesize CDK stacks - CI pipeline fails on build/test stages with CDK bundling
- Recently merged code from another contributor who uses a different package manager
Solution
Step 1: Identify the Project's Package Manager
Check for these indicators (in order of reliability):
Step 2: Remove the Incorrect Lock File
Step 3: Prevent Future Occurrences
Add the unwanted lock files to .gitignore:
Step 4: Commit and Verify
Verification
After removing the incorrect lock file:
npx cdk synthcompletes without bundling errors- CI pipeline passes the test stage
- Only one lock file exists in the repository
Example
Scenario: CI fails with this error after merging a PR:
Investigation:
Resolution: Project uses npm (based on CI config). Remove pnpm-lock.yaml:
Notes
- This commonly happens when contributors use different package managers locally
- pnpm automatically creates pnpm-lock.yaml when running any pnpm command
- Some IDEs auto-run package managers, creating unexpected lock files
- CDK's esbuild bundler is strict about having exactly one lock file
- The error occurs at synth time, not deployment time
Related
- See also: cdk-temp-folder-disk-bloat (another CDK bundling issue)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cdk-multiple-lock-file-bundling/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cajias/claude-skills/cdk-multiple-lock-file-bundling)