tojocky / node-printer

Native node.js printer
1.51k stars 436 forks source link

Windows install failing for electron #293

Closed avilesj closed 4 years ago

avilesj commented 4 years ago

I'm currently trying to get this library working and I'm having trouble.

Installation

I opted to go this way for installing.

npm install -g node-gyp
npm install printer --msvs_version=2013  --build-from-source=node_printer

And since I'm using both, NodeJS 12 and Electron 8.2.5, I followed this pr #289 to get it to compile.

I also installed windows-build-tools globally.

The problem

When I compile the project (in typescript, with webpack), I get the error that node_printer_win32_x64.node cannot be found. I followed this issue #246 and I'm still having this issue.

Solution Attempts

I've looked issues related to installation but I can't seem to find anything related to windows that could actually help me.

Thanks for any help offered and thank you @tojocky for making this using native modules! (Other solutions just rely on another executable file to accomplish this)

avilesj commented 4 years ago

Update

I tried just using node and just javascript and I can actually get it working. Seems to be mostly a webpack or electron issue, I'll see if I figure it out.

I'm still open for any kind of help regarding this. Thanks!

avilesj commented 4 years ago

I sadly had to downgrade electron to 6.1.7 as specified in #282 .

Initially I was: Node 12.16.1 Electron 8.2.5

Now I am: Node 12.13.0 Electron 6.1.7

Full windows installation steps for me:

Of course, if you're using electron remember to call printer from the main process. To use it in the render process call the remote utility within electron.

I'm also disappointed I couldn't find a table matching nodejs/electron versions. The one at electron/node is outdated and the website doesn't show an obvious way to find it (Seems to be only found on major version changes, like 8.0.0 release notes)

Will leave the issue open until monday to see if anyone chimes in and shows me a better way to do this.