Closed tmigone closed 1 year ago
Probably too late for you to care, but if you check .pkg-cache after it tries to download (and fails) the pre-built binary, check which version has .downloading in the filename and take note. Remove the file. Then, take the binary you do have and rename it to that copied value (and remove .downloading). Run pkg
again and it should use the fetched version.
I believe the issue is due to 'pkg' checking for the very latest version of the node distro you want to use.
@geeklisted in my case it just deletes the binary I've pasted and tries to build from source from the logs:
> pkg@5.7.0
> Fetching base Node.js binaries to PKG_CACHE_PATH
> Binary hash does NOT match. Re-fetching...
fetched-v12.22.11-linux-armv7 [ ] 0%
we can see, that it verifies checksum and it fails
@sinnrrr Latest version of pkg-fetch also does checksum checks, I suggest to use an old pkg version instead or to patch the code to skip checksum checks.
https://github.com/vercel/pkg-fetch/blob/main/lib/expected.ts#L1
Patch lines: https://github.com/vercel/pkg-fetch/blob/main/lib/index.ts#L121 https://github.com/vercel/pkg-fetch/blob/main/lib/index.ts#L143
Just remove the checks in this two lines and it should work
Now it works
Using pkg 5.3.1 which uses pkg-fetch 3.2.2, downloaded binary for arm6, moved it into the cache folder but pkg still tries to build from source.