相关文章推荐
威武的灯泡  ·  Docker 中的 PHP ...·  1 年前    · 
喝醉的鸡蛋面  ·  Spring Data ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have developed a node API for my angular application, My node application uses node-printer package for printing pdf files generated by node, when i tried to run my application using nodemon i am getting an error

node printer.node is not a valid win32 application

The same application is working on the other machine without any error. both the machines are of X64 bit architecture.

also i have also tried to install node js 32 bit then too i am getting same error.

Hi there let me go through what's happened on my site here in 2022.

So if you're going to use npm install printer for your Electron application, you're using a native module as deemed by electron.

Since Electron has a different application binary interface (ABI) from a given Node.js binary that you used to install your printer . Therefore, we need to rebuild the native module (in this case printer) for Electron.

For more detail check this out.

  • First, install electron-rebuild for your project. npm i electron-rebuild .

  • Second, install a native module using e.g. npm i printer

  • Third, after installed native module, execute ./node_modules/.bin/electron-rebuild to rebuild the native module.

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question . Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers .

  •