Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified executable is not a valid application for this OS platform.At line:1 char:1 #4312

Open
Drjacky opened this issue Dec 15, 2023 · 3 comments

Comments

@Drjacky
Copy link

Drjacky commented Dec 15, 2023

Details

I built a self-contained (not sure if this is the same as single executable app) by running following https://nodejs.org/api/single-executable-applications.html pkg . in the source code folder (in my macoS machine). And it gave me 3 executables for different OS.
I used the windows one in a windows machine and it shows this error:

PS C:\Users\User\Desktop\avocado> .\avocado.exe --version
Program 'avocado.exe' failed to run: The specified executable is not a valid application for this OS platform.At
line:1 char:1
+ .\avocado.exe --version
+ ~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ .\avocado.exe --version
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

Node.js version

21.3.0

Example code

https://github.com/Drjacky/Avocado

Operating system

macOS

Scope

runtime

Module and version

Not applicable.

Related

vercel/pkg#2031
nodejs/single-executable#85
vercel/pkg#2037

@preveen-stack
Copy link
Contributor

Cc @nodejs/single-executable PTAL

@Drjacky
Copy link
Author

Drjacky commented Jan 7, 2024

Update:

The one that has been built by pkg . works but following https://nodejs.org/api/single-executable-applications.html, the built binary shows that error ☝🏼

@RedYetiDev
Copy link
Member

RedYetiDev commented Jun 27, 2024

Is this issue still occuring? if not, feel free to self-close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants