π¨ CI/CD Enhancement Request: Auto-detect pnpm cache setup dependencies
Resolved π¬ 4 comments Opened Aug 10, 2025 by workmusicalflow Closed Jan 7, 2026
π¨ CI/CD Pipeline Failure - pnpm Cache Setup Issue
π― Problem Summary
GitHub Actions workflow fails at "Setup Node.js & pnpm cache" step with actions/setup-node@v4 when using cache: 'pnpm' because pnpm is not pre-installed.
π Root Cause Analysis
- Error:
actions/setup-node@v4withcache: 'pnpm'requires pnpm to be installed BEFORE the setup-node step - Impact: All CI/CD workflows hanging/failing on dependency resolution
- Context: pnpm workspace monorepo with NestJS API + Nuxt.js web apps
β Solution Implemented
# BEFORE (β Fails)
- name: π¦ Setup Node.js & pnpm cache
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm' # β Fails - pnpm not installed yet
# AFTER (β
Works)
- name: π¦ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: π¦ Setup Node.js & pnpm cache
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm' # β
Works - pnpm now available
π§ Technical Details
- Repository: pnpm workspace monorepo
- Node.js: v20
- pnpm: v8
- Actions:
actions/setup-node@v4pnpm/action-setup@v2
π Additional Optimizations Applied
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
HUSKY: 0
jobs:
build:
timeout-minutes: 15 # Prevent hanging jobs
steps:
- name: π¦ Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: π¦ Setup Node.js & pnpm cache
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: π₯ Install dependencies
run: pnpm install --frozen-lockfile
π― Request for Claude Code Support
Could Claude Code GitHub Actions be enhanced to:
- Auto-detect pnpm requirements: When
cache: 'pnpm'is used, automatically suggest addingpnpm/action-setupfirst - Workflow validation: Check action order dependencies before committing workflow files
- Monorepo templates: Provide optimized workflow templates for pnpm workspaces
- Timeout recommendations: Suggest appropriate
timeout-minutesbased on project size
π Current Status
- β Issue identified and fixed manually
- β
Shadow workflow
ci-cd-mvp-v2.ymlcreated for testing - π Monitoring pipeline execution
- β³ Ready for PR to main branch once validated
π Related Files
.github/workflows/ci-cd-mvp-v2.yml(fixed workflow)pnpm-workspace.yaml(monorepo config)package.json(workspace root)
π‘ Impact
This fix enables reliable CI/CD for pnpm monorepos and prevents common setup-node cache failures that affect many TypeScript/Node.js projects.
---
Priority: High - Blocks all CI/CD operations
Environment: GitHub Actions, pnpm workspace, Node.js 20
Fix Applied: β
Working solution implemented
This issue has 4 comments on GitHub. Read the full discussion on GitHub β