Does this work with latest pkg?
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.
root@1611399:/usr/src# ls -al ~/.pkg-cache/v3.2/
total 92800
drwxr-xr-x 2 root root 4096 Aug 24 14:56 .
drwxr-xr-x 3 root root 4096 Aug 24 14:51 ..
-rwxr-xr-x 1 root root 28755972 Aug 24 14:56 fetched-v12.22.2-linuxstatic-armv7
-rwxr-xr-x 1 root root 66259348 Aug 24 14:52 fetched-v14.0.0-linux-armv6
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:
> [email protected]
> 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