Node.js addon.node error

Product Version:
@pdftron/pdfnet-node": “^9.2.0-1”
Please give a brief summary of your issue:
developed the project on Mac, run it on windows shows addon.node error

Please describe your issue and provide steps to reproduce it:

Based on this sample:

I have developed a node.js server to perform text extraction. everything works fine until I try to run “node index.js” on my windows laptop and it shows an error:
addon: ‘Error: \\?\D:\NodeJsServer\node_modules\@pdftron\pdfnet-node\lib\addon.node is not a valid Win32 application.\r\n’ +

My node version is v12.18.0
windows 11 Home 64-bit OS.

I tried to upgrade my Node.js to v14 and v16 but still showing same error.

Please help

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Our SDK is a native binary

Linux :
macOS : libPDFNetC.dylib
Windows :PDFNetC.dll

I suspect you are copying over your mac package, which just has the dylib, but to run on windows you need the DLL.

yes I developed my project on Mac and then push to the github. After I pull it to my windows laptop it shows error. Do I need to reinstall any packages?

Yes, I believe when you install NPM pulls the correct binary.

Perhaps there is a way to force NPM to install additional binaries, so that just checking out works.

thank you. Run “npm install” and the same error still shows. In the end I fix it by deleting the whole node_module folder and running “npm install” again