help icon indicating copy to clipboard operation
help copied to clipboard

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

Open Drjacky opened this issue 1 year ago • 3 comments

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

https://github.com/vercel/pkg/issues/2031 https://github.com/nodejs/single-executable/issues/85 https://github.com/vercel/pkg/issues/2037

Drjacky avatar Dec 15 '23 09:12 Drjacky

Cc @nodejs/single-executable PTAL

preveen-stack avatar Jan 07 '24 04:01 preveen-stack

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 ☝🏼

Drjacky avatar Jan 07 '24 11:01 Drjacky