action-setup: Action failing with setup that has previously been working

Getting the following error when running action. Action was working yesterday, and has worked for almost a year.

Running self-installer...
   WARN  GET https://registry.npmjs.org/pnpm error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
   WARN  GET https://registry.npmjs.org/pnpm error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
   ERR_PNPM_META_FETCH_FAIL  GET https://registry.npmjs.org/pnpm: Value of "this" must be of type URLSearchParams
Error: Something went wrong, self-installer exits with code 1
Installation Completed!

This is our setup:

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 68
  • Comments: 31 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Upgrading the action to v4 seems to fix this:

        uses: pnpm/action-setup@v4

Appreciate that upgrading to v4.0.0 may solve the problem, but addressing this in dozens of GitHub workflows on a US Holiday is a nightmare. To say nothing of dozens of broken builds that cannot be reinitiated after the workflow change. What caused this to break? Can it be restored?

Seeing this as well with version: 8.11.0. Was totally fine a couple hours ago.

Appreciate that upgrading to v4.0.0 may solve the problem, but addressing this in dozens of GitHub workflows on a US Holiday is a nightmare. To say nothing of dozens of broken builds that cannot be reinitiated after the workflow change. What caused this to break? Can it be restored?

It seems that this issue may be related to the fetch API. Currently, pnpm/action-setup@v2 is using Node.js@v16, which has reached its EOL. It is also possible that GitHub Actions have abandoned the use of this version and fallback to a higher version. The above is just speculation.

only the modern javascript ecosystem can have software be broken absolutely out of nowhere

Upgrading the action to v4 seems to fix this:

        uses: pnpm/action-setup@v4

Upgrading to v4 works for us, thanks @fvictorio !

@bobinfra1006

I change my pnpm/action-setup@v4,but still error. Error: Multiple versions of pnpm specified: Error: Error: Multiple versions of pnpm specified:

  • version 8.11.0 in the GitHub Action config with the key “version”
  • version pnpm@9.0.6 in the package.json with the key “packageManager” Remove one of these versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION
  • version 8.11.0 in the GitHub Action config with the key “version”
  • version pnpm@9.0.6 in the package.json with the key “packageManager” Remove one of these versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION at readTarget (/home/runner/work/_actions/pnpm/action-setup/v4/dist/index.js:1:4528) at runSelfInstaller (/home/runner/work/_actions/pnpm/action-setup/v4/dist/index.js:1:3742) at async install (/home/runner/work/_actions/pnpm/action-setup/v4/dist/index.js:1:2976) at async main (/home/runner/work/_actions/pnpm/action-setup/v4/dist/index.js:1:444)

Here is a possible issue where the pnpm version specified in the package.json does not match the version specified in the GitHub Action configuration. I encountered the same issue, but I was able to resolve it by aligning the pnpm version specified in the package.json with the version specified in the GitHub Actions configuration.

Failed with pnpm version:9 as well for us.

Upgrading action to 4 worked!!!

It seems that this issue may be related to the fetch API. Currently, pnpm/action-setup@v2 is using Node.js@v16, which has reached its EOL. It is also possible that GitHub Actions have abandoned the use of this version and fallback to a higher version. The above is just speculation.

Adding to this, GitHub deprecated Node.js v16 (EOL) last year and there should’ve been warnings since 23 Oct 2023. https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

To stop this from happening again, setup Dependabot/Renovate to update your GitHub Actions.

This fix worked when jumping from pnpm/action-setup@v2 . Thanks @fvictorio !

upgrading to v4 fixes this for me