Hi, I love pkg. It's a really simple tool. However, I'm running into a problem when I'm trying to create an executable of my node script for a Windows 7, 32 bit system on a MacOS 64 bit system.
When I run the following command:
pkg ./src/index.js --targets=latest-win-x86
I get the following error log:
`Error! 404 Not Found
https://github.com/zeit/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v12.2.0-macos-x86
Asset not found by direct link:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.2.0-macos-x86"}
Not found in GitHub releases:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.2.0-macos-x86"}
Building base binary from source:
built-v12.2.0-macos-x86
Error! Not able to build for 'x86' here, only for 'x64'`
Does this imply that I simply cannot build for the x86 arch on my 64 bit system? Or is there a simple work around for this?
Related to: https://github.com/zeit/pkg-fetch/issues/68
This is a problem with the latest build of the node-binaries pkg bundles your application with.
I am currently reverting to pkg 4.3.8 which works.
I also came across this issue. It has to do with pkg's attempt to compile your app into binary into the exe instead of leaving it in source format.
Here are some workarounds I've found:
Alternatively, if you're comfortable with shipping your source code instead of having it compiled into a binary format, you can disable that feature by passing the following arguments to pkg:
--no-bytecode --public --public-packages '*'
Thats a good solution from Dan, my app would compile with:
--no-bytecode --public --public-packages '*'
But I think Id need to include a bunch of files alongside the app which aint cool.
This explains why my mac is able to build win32 images ok, using [email protected], but my linux box has trouble, it is running 4.4.0. Although my linux is still unable with 4.3.4 still.
My theory is the bug is regarding this error:
Error! TypeError: Expected
cwdto be of typestringbut received typeundefined
To me this says perhaps you cant build from a script, it prefers an interactive shell. Because my script not work, eg npm run build but just running pkg on the command line better, it requires to now the cwd = current working directory.
I fixed it by switching back and only running pkg from the CLI not a script:
npm install -g [email protected]
pkg . --targets win-x86 --output ./dist/AminoSee_win/aminosee-win32.exe
@tomachinz thanks.
It successfully starts the command with 4.3.4 version, however I am getting
Expected 'cwd' to be of type 'string' but received type 'undefined'
@4.3.8 fixed the thing.
Hi Guys,
I ran this command, pkg app.js --targets win-x86 and i get the below error.
I tried to revert back to an older version of pkg, but it still doesnt work.
Can someone please help?
[email protected]
Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v12.13.1-macos-x86 [ ] 0%
Error! 404 Not Found
https://github.com/zeit/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v12.13.1-macos-x86
Asset not found by direct link:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.13.1-macos-x86"}
Not found in GitHub releases:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.13.1-macos-x86"}
Building base binary from source:
built-v12.13.1-macos-x86
Error! Not able to build for 'x86' here, only for 'x64'
what is the exact command you are typing to run this? is it by hand at the terminal, or are you using something like npm run pkg or similar script line?
maybe try somehow to run an older version of pkg for that particular build.
what is the exact command you are typing to run this? is it by hand at the terminal, or are you using something like
npm run pkgor similar script line?
Im running it by hand from my terminal. If i dont specify any targets, it works perfectly fine with the x64 bit binary.
I want to target a 32bit win os as part of my work project.
i downgrade my node version back to v8 and it worked. All good =)
Hi Guys,
I ran this command, pkg app.js --targets win-x86 and i get the below error.
I tried to revert back to an older version of pkg, but it still doesnt work.
Can someone please help?
[email protected]
Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v12.13.1-macos-x86 [ ] 0%
Error! 404 Not Found
https://github.com/zeit/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v12.13.1-macos-x86
Asset not found by direct link:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.13.1-macos-x86"}
Not found in GitHub releases:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.13.1-macos-x86"}
Building base binary from source:
built-v12.13.1-macos-x86
Error! Not able to build for 'x86' here, only for 'x64'
Having the same issue. Is there any updates on the issue?
Hi Guys,
I ran this command, pkg app.js --targets win-x86 and i get the below error.
I tried to revert back to an older version of pkg, but it still doesnt work.
Can someone please help?[email protected]
Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v12.13.1-macos-x86 [ ] 0%
Error! 404 Not Found
https://github.com/zeit/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v12.13.1-macos-x86
Asset not found by direct link:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.13.1-macos-x86"}
Not found in GitHub releases:
{"tag":"v2.6","name":"uploaded-v2.6-node-v12.13.1-macos-x86"}
Building base binary from source:
built-v12.13.1-macos-x86
Error! Not able to build for 'x86' here, only for 'x64'Having the same issue. Is there any updates on the issue?
Yeh mate. What version of node are you running atm? I revert back to version 8 and it worked for me.
12.x. We made a big effort to migrate to 12.x. There is no way we are coming back to 8.x
Any updates on this?
Most helpful comment
Related to: https://github.com/zeit/pkg-fetch/issues/68
This is a problem with the latest build of the node-binaries pkg bundles your application with.
I am currently reverting to pkg 4.3.8 which works.