CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.45k stars 111 forks source link

error when using in github actions on ubuntu-latest #574

Open testersen opened 6 months ago

testersen commented 6 months ago
Failed to run pagefind via the npx wrapper: Error: Failed to install either of [pagefind_extended, pagefind]. Most likely the platform linux-x64 is not yet a supported architecture.
Please open an issue at https://github.com/CloudCannon/pagefind and paste this error message in full.
If you believe this package should be compatible with your system,
you can try downloading a release binary directly from https://github.com/CloudCannon/pagefind/releases
Please open an issue at https://github.com/CloudCannon/pagefind and paste this error message in full.
testersen commented 6 months ago

Temporary fix: image

Because Starlight already runs npx pagefind -y --site dist, I would like to avoid this solution.

bglw commented 6 months ago

I'll see if I can reproduce this, but any failure here can (unfortunately) likely be traced to npm's installation flow rather than Pagefind's code. Due to the way Pagefind has to package, the binary is technically an "optional" dependency, so failures installing that package can be suppressed.

One other avenue to try might be to install the packages ahead of the build, meaning npx should use those instead of downloading them:

npm i pagefind @pagefind/linux-x64

(The likely issue being @pagefind/linux-x64 failed to install for some unknown reason)

nhoizey commented 2 months ago

For information, I now get the same error in Netlify.

It looks like I upgrade Node from 20 to 22 in my .nvmrc, I don't know if it is really related and might help fix the issue.

nhoizey commented 2 months ago

Reverting to Node 20 didn't fix the issue.

nhoizey commented 2 months ago

Forcing installation of Pagefind did fix the issue: https://github.com/nhoizey/nicolas-hoizey.photo/commit/b8e387ee59b7b127243410a1925cb77a95bd2250

bglw commented 2 months ago

Interesting! Thanks for the notes. Something to keen an eye on 👀