Not working as expected for ARMv7
Closed this issue · 4 comments
I downloaded the binaries using curl into ~/.pkg-cache/custom.
Then set the environment variables as mentioned in the README.
I am using the latest version of @yako-pkg/pkg. (v5.11.5).
Within my project folder I have a single index.js file. When I run the command:
npx pkg -t node16-linux-armv7 index.js
I get the following output:
> pkg@5.11.5
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v16.20.2-linux-armv7 [ ] 0%
> Error! 404: Not Found
> Not found in remote cache:
{"tag":"v3.5","name":"node-v16.20.2-linux-armv7"}
> Building base binary from source:
built-v16.20.2-linux-armv7
> Fetching Node.js source archive from nodejs.org...
node-v16.20.2.tar.gz.sha256sum [====================] 100%
node-v16.20.2.tar.gz [= ] 7%^
It doesn't recognize the built-v16.16.0-linux-armv7
binary within ~/.pkg-cache/custom and tries to build from source.
I have both @yao-pkg/pkg and my project folders within WSL2 in my Windows machine with a x86 architecture. I need to cross compile into armv7 within this environment. Any help would be appreciated.
Checking it on the latest version using: npx pkg -t node20-linux-armv7 index.js
Starts a new download fetched-v20.11.1-linuxstatic-armv7
but hangs in the process. That also ignores the downloaded binary built-v20.11.1-linux-armv7
.
each pkg version looks for a specific nodejs version, you should use the one that it expects (or you could also rename it the same way it expect to find)
I'm still having the same issue. I'm not sure what I'm doing wrong.
The steps I followed:
- Change .bashrc to change the two environment variables.
- Run
npx pkg -t node20-linux-armv7 index.js
: This results in the output on the first comment with pkg trying to compile it to binary from source. - Run
npx pkg -t node20-linuxstatic-armv7 index.js
: Which results in pkg downloading the binary but the process hanging without completing.
Since I'm using the latest pkg version from the forked repo (@yao-pkg/pkg), it seems to me that I don't need to manually download the binary from the releases page of this repo (@yao-pkg/pkg-binaries).
Unsure of how to proceed further.
Came across: https://github.com/yao-pkg/pkg-fetch/
Which says only Node 16 and 18 are supported on ARMv7 and sure enough it worked. Posting it here incase someone else runs into the same issue as me.