Then goto app folder install native module 'node-printer'
npm install printer --save
the boilerplate project will auto rebuild native module successes
add some reference in main.dev.js
import * as printer from 'printer';
console.log(printer.getPrinters());
in the root folder
npm run dev
It's seems ok, information of installed printers output to console
but when I want package the project. an error encountered
npm run package-win
...
electron-builder Two package.json structure is used (dev: C:\Users\kenni\Developer\erp-printer\package.json, app: C:\Users\kenni\Developer\erp-printer\app\package.json) +1s
electron-builder Unresolved dependencies after first round: printer +181ms
️ Unresolved node modules: printer
...
so why package-builder can not find module printer ? How can I fix it ?
Which version of electron-builder are you using? 19.42.2
What target are you building for? --win --ia32
Unresolved native module
I have clone a boilerplate project from this repo.
chentsulin/electron-react-boilerplate
Then goto app folder install native module 'node-printer'
the boilerplate project will auto rebuild native module successes add some reference in main.dev.js
in the root folder
It's seems ok, information of installed printers output to console
but when I want package the project. an error encountered
so why package-builder can not find module printer ? How can I fix it ?
Thank you!