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

Build flag with windows-x64-20.11.1 produces 16bit results ? #1088

Open
Megajin opened this issue Mar 24, 2024 · 1 comment
Open

Build flag with windows-x64-20.11.1 produces 16bit results ? #1088

Megajin opened this issue Mar 24, 2024 · 1 comment
Labels

Comments

@Megajin
Copy link

Megajin commented Mar 24, 2024

What happened:

Hi, I was trying to use nexe to build an executable file for windows x64 with the newest NestJS on my system Zorin OS 17.1 Pro. My Application is just the Hello World example when using @nx/nest to initialize a simple NestJS App. The releases were missing node 20.11.1 so I went with the build flag: npx nexe ./dist/apps/main.js -t windows-x64-20.11.1 -o test-server.exe --python=$(which python3) --build

Build process went through without any errors. However once I have moved the exe to my target Windows System (Microsoft Windows Server 2022 Datacenter) it crashed with the following message:

// Translated from Image
16-bit application not supported
The Program or the feature "\??\C:\Program\Files\...\x-server.exe" 
cannot be started or executed due to incompatibility with 64-bit versions of Windows. 
Contact the software manufacturer to find out whether a version compatible with 64-bit Windows is available.

error-message

What you expected to happen:

The Endproduct should be 64x since I have used the right target: -t windows-x64-20.11.1.

How to reproduce it (as minimally and precisely as possible):

Create a Monorepo with the latest NX Version and NestJS: npx create-nx-workspace my-workspace --preset=nest leave everything as is with the hello world example and install the latest nexe. After that use the command: npx nexe ./dist/apps/main.js -t windows-x64-20.11.1 -o test-server.exe --python=$(which python3) --build . Make sure you have Node 20.11.1 installed.

Anything else we need to know?:

Here are the target machine specs:

target-machine

Environment:

  • Platform(OS/Version): Zorin OS 17.1 Pro
  • Host Node Version: 20.11.1
  • Target Node Version: 20.11.1
  • Nexe version: 4.0.0-rc.4
  • Python Version: 3.10.12
@Megajin Megajin added the bug label Mar 24, 2024
@chrisbenincasa
Copy link

I encountered something similar recently. From what I understand now, it seems like the --build flag will effectively override the target arch.

I have a locally-compiled version of 20.11.1 for Linux on my machine. When I specify --build with the Windows target, which doesn't have a prebuilt binary, I get a normal Linux executable file, see below:

) ✗ pnpm nexe -t windows-x64-20.11.1 --build --name test-binary --verbose 
ℹ nexe 5.0.0-beta.1
✔ Resolving dependencies...
✔ Downloading Node.js source from: https://nodejs.org/dist/v20.11.1/node-v20.11.1.tar.gz
✔ Already downloaded...
✔ Compiling result
✔ Writing result to file
✔ Entry: 'src/index.ts' written to: test-binary.exe
✔ Finished in 0.143s
➜  server git:(main) ✗ file test-binary
test-binary: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d463c17d1f6f4a4096f336ba42aa6395ee1d3f1d, for GNU/Linux 3.2.0, with debug_info, not stripped
➜  server git:(main) ✗ 

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

No branches or pull requests

2 participants