No native build was found for platform=win 32

2.7k Views Asked by At

I am getting the following error in the auto-start(Run entry in Regedit to Auto-Start) App after restarting the app or stop auto-start and started manually then its working file.

Error

No native build was found for platform=win 32
loaded from: C:\WINDOWS\System32\node_modules\ffi-napi\node_modules\ref-napi.

Here actual prebuild path is installation dir ie %APPDATA%/appname/node_modules but first time its taking C:\WINDOWS\System32\node_modules.

I compared both processes I only found the difference is "NativeModule internal/fs/read_file_context" is missing.

Added prebuilt as follows in electron app.

extraFiles: [
'./node_modules/ffi-napi/prebuilds/**/*',
'./node_modules/ffi-napi/node_modules/ref-napi/prebuilds/**/*',
'./node_modules/ref-napi/prebuilds/**/*',
...
]

I really don't know what is going wrong for the first time. Please help. Thanks in advance :)

1

There are 1 best solutions below

0
On

After debugging the Exe application I found extrafiles prebuilt fail sometimes to access relative path. hence I used webpabck-externals

externals = [
'ffi-napi':"require('ffi-napi')"
]