pnpm / action-setup

Install pnpm package manager
https://github.com/marketplace/actions/setup-pnpm
MIT License
899 stars 87 forks source link

Fail to Install pnpm on GitHub Actions with ERR_PNPM_FETCH_404 #55

Closed plylrnsdy closed 1 year ago

plylrnsdy commented 1 year ago

My config

name: Deploy Blog

on:
  push:
    branches:
      - main

jobs:
  deploy-gh-pages:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Install pnpm
        uses: pnpm/action-setup@v2 # I try both v2 or v2.2.2
        with:
          version: 7
          run_install: true

# ... other action

Error Message:

Run pnpm/action-setup@v2.2.2
Running self-installer...
Installation Completed!

Running pnpm recursive install...
  Lockfile is up to date, resolution step is skipped
  Progress: resolved 1, reused 0, downloaded 0, added 0
  .                                        | +575 ++++++++++++++++++++++++++++++++
  Packages are hard linked from the content-addressable store to the virtual store.
    Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
    Virtual store is at:             node_modules/.pnpm
  Progress: resolved 575, reused 0, downloaded 21, added 19
   WARN  GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
  Progress: resolved 575, reused 0, downloaded 140, added 137
  Progress: resolved 575, reused 0, downloaded 187, added 184
  Progress: resolved 575, reused 0, downloaded 275, added 274
  Progress: resolved 575, reused 0, downloaded 342, added 339
   WARN  GET https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
  Progress: resolved 575, reused 0, downloaded 481, added 475
  Progress: resolved 575, reused 0, downloaded 5[6](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065146727/jobs/4948951570#step:3:7)1, added 556
  Progress: resolved 575, reused 0, downloaded 572, added 572
  Progress: resolved 575, reused 0, downloaded 573, added 572
  Progress: resolved 575, reused 0, downloaded 573, added 573
   WARN  GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
   WARN  GET https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz error (ERR_PNPM_FETCH_[40](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065146727/jobs/4948951570#step:3:42)4). Will retry in 1 minute. 1 retries left.
  undefined
   ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz: Not Found - 404

  No authorization header was set for the request.
Error: Command pnpm recursive install (cwd: undefined) exits with status 1

I try to open these links. They actual do not exist.

https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz
https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz
KSXGitHub commented 1 year ago

Can you try separating this block:

      - name: Install pnpm
        uses: pnpm/action-setup@v2 # I try both v2 or v2.2.2
        with:
          version: 7
          run_install: true

into:

      - name: Install pnpm
        uses: pnpm/action-setup@v2 # I try both v2 or v2.2.2
        with:
          version: 7
          run_install: false

      - name: Install dependencies
        run: pnpm install --recursive

and see if it's the same result?

plylrnsdy commented 1 year ago

I try to remove run_install: true

name: Deploy Blog

on:
  push:
    branches:
      - main

jobs:
  deploy-gh-pages:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Install pnpm
        uses: pnpm/action-setup@v2
        with:
          version: 7

      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: pnpm

      - name: Install dependencies
        run: pnpm install --frozen-lockfile

# ... other action

Now it can run into Install dependencies, but it throws same error:

Run pnpm install --frozen-lockfile
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
Packages: +575
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /home/runner/.local/share/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 575, reused 0, downloaded 10, added 9
 WARN  GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz error (ERR_PNPM_FETCH_404). Will retry in 10 seconds. 2 retries left.
Progress: resolved 575, reused 0, downloaded 53, added 50
Progress: resolved 575, reused 0, downloaded 12[6](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065265181/jobs/4949190343#step:5:7), added 122
Progress: resolved 5[7](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065265181/jobs/4949190343#step:5:8)5, reused 0, downloaded 167, added 165
Progress: resolved 575, reused 0, downloaded 1[8](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065265181/jobs/4949190343#step:5:9)4, added 183
Progress: resolved 575, reused 0, downloaded 244, added 242
Progress: resolved 575, reused 0, downloaded 278, added 276
Progress: resolved 575, reused 0, downloaded 318, added 318
Progress: resolved 575, reused 0, downloaded 422, added 420
 WARN  GET https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz error (ERR_PNPM_FETCH_404). Will retry in [10](https://github.com/plylrnsdy/plylrnsdy.github.io_source/actions/runs/3065265181/jobs/4949190343#step:5:11) seconds. 2 retries left.
Progress: resolved 575, reused 0, downloaded 506, added 504
Progress: resolved 575, reused 0, downloaded 564, added 564
Progress: resolved 575, reused 0, downloaded 571, added 571
 WARN  GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
Progress: resolved 575, reused 0, downloaded 572, added 572
Progress: resolved 575, reused 0, downloaded 573, added 573
 WARN  GET https://registry.npmjs.org/concat-map/download/concat-map-0.0.1.tgz error (ERR_PNPM_FETCH_404). Will retry in 1 minute. 1 retries left.
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.5.tgz: Not Found - 404

No authorization header was set for the request.
Error: Process completed with exit code 1.
KSXGitHub commented 1 year ago

Then it's not the fault of pnpm/action-setup. It's either a pnpm bug, a registry bug, or a package.json bug.

plylrnsdy commented 1 year ago

Thanks.

This issue is related to pnpm#3744.

Because I use third party's registry globally, I need to setup same registry on GitHub Actions.

name: Deploy Blog

on:
  push:
    branches:
      - main

jobs:
  deploy-gh-pages:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Install pnpm
        uses: pnpm/action-setup@v2
        with:
          version: 7

      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: pnpm

      - name: Use taobao registry
        run: npm config set registry https://registry.npmmirror.com/

      - name: Install dependencies
        run: pnpm install --frozen-lockfile

# ... other action