question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tmp.Node is not a valid Win32 application

See original GitHub issue
  • Version: 22.4.1

  • Electron Version: 9.2.1

  • Target: Mac, Windows, Linux

I am trying to build my electron application for all 3 platforms. I am using mac as build server. I am using below given command to build

electron-builder -mwl

Below is my build configuration in package json. Also note that i am using sqlite3 package which i use by running electron rebuild command.

"build": {
   "appId": "appName",
   "directories": {
     "output": "output-path"
   },
   "mac": {
     "category": "your.app.category.type",
     "icon": "/desktop-app-icon-mac-512.icns",
     "target": "dmg"
   },
   "win": {
     "icon": "/desktop-app-icon-win-256.ico",
     "target": [
       {
         "target": "nsis",
         "arch": [
           "x64",
           "ia32"
         ]
       }
     ]
   },
   "linux": {
     "target": [
       {
         "target": "AppImage",
         "arch": [
           "x64"
         ]
       }
     ]
   },
   "files": [
     "/views/"
   ],
   "publish": {
     "provider": "generic",
     "url": ""
   },
   "nsis": {
     "deleteAppDataOnUninstall": true
   }
 }

Generated DMG file works successfully on mac, but after installing executable on 64 bit machine, below given error is logged in renderer process console

Uncaught Error: Uncaught (in promise): Error: \\?\{local-dir-path}\AppData\Local\Temp\10\1435ac1f-8452-42d8-952d-e07381d1b44b.tmp.node is not a valid Win32 application.
\\?\{local-dir-path}\AppData\Local\Temp\10\1435ac1f-8452-42d8-952d-e07381d1b44b.tmp.node
Error: \\?\{local-dir-path}\AppData\Local\Temp\10\1435ac1f-8452-42d8-952d-e07381d1b44b.tmp.node is not a valid Win32 application.
\\?\{local-dir-path}\AppData\Local\Temp\10\1435ac1f-8452-42d8-952d-e07381d1b44b.tmp.node
    at process.func [as dlopen] (electron/js2c/asar.js:140:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1034:18)
    at Object.func [as .node] (electron/js2c/asar.js:149:18)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> ({local-dir-path}\AppData\Local\Programs\{app-name}\resources\app.asar\node_modules\sqlite3\lib\sqlite3-binding.js:4:15)

It seems like 32-bit version got installed on 64 bit windows machine. If i create build for windows-only on 64-bit windows machine, then it is working fine. As it is clear in configuration, i am creating installer for both 32 and 64 bit platforms, i can confirm that installer contains both 32 and 64 bit application because my exe file got doubled once i included 32 bit architecture.

Does anybody else had the same issue? Kindly share your experiences.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
asadmalik3commented, Sep 7, 2020

@jjason685 Thank you for the suggestion. My problem got fixed too by upgrading sqlite3 to latest version (^5.0.0).

1reaction
jjason685commented, Sep 7, 2020

@asadmalik3 I was. Sorry for the late response, but I fixed it simply by upgrading sqlite3 to the latest version (^5.0.0 for me). Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node is not a valid Win32 application - Stack Overflow
When you npm install -ed it installed a binary for the system you were using at that time, for example, you were on...
Read more >
Methods to Resolve Not a Valid Win32 Application Error [2022]
This tutorial has been designed to resolve the issue when the system says that a particular program is not a valid win32 application....
Read more >
Electron | Tencent Cloud
When I ran the SDK on 32-bit Windows, the error “Error:resource\\trtc_electron_sdk.node is not a valid Win32 application” occurred and the ...
Read more >
How to Fix "not a valid Win32 application" with (Simple Steps)
1. Re-register Shell32. · 2. Fix it using FixExec Tool (Automatically) · 3. Make sure the file is not corrupted – Download the...
Read more >
Realm.node is not a valid Win32 application - MongoDB
Hi All, We have started the integration testing for our atlas functions as per the below link. We have a test function with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found