#github pages pnpm version error
2 messages · Page 1 of 1 (latest)
This happens when the Astro GitHub Action can’t detect which package manager/version to use. The action auto-detects from your lockfile; you must commit your lockfile (e.g., pnpm-lock.yaml). If detection still fails, explicitly set the package manager in the workflow.
- Ensure pnpm lockfile is committed (required for auto-detect) (see the caution about committing a lockfile) (Deploy to GitHub Pages).
- Or, set package-manager in your workflow:
# .github/workflows/deploy.yml
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: withastro/action@v3
with:
package-manager: pnpm@latest # explicitly specify pnpm
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4