Node.js native module is not a valid Win32 application error

前端 未结 4 1845
庸人自扰
庸人自扰 2021-02-07 05:11

Trying to make Hello World native module for node.js

Got an Win32 Project in VS 2012 with one file:

#include 

        
4条回答
  •  粉色の甜心
    2021-02-07 05:42

    In my case, the issue was trying to execute an Electron app on Windows that was built (for Windows) using Linux. I solved by building it (for Windows) using Windows.

    To build it on windows I used the following commands:

    npm install --global-production windows-build-tools
    npm install
    npm run build:prod && electron-builder build --windows
    

    To execute the last command you need electron-builder, install it if you do not have with

    npm install --save-dev electron-builder
    

提交回复
热议问题