tojocky / node-printer

Native node.js printer
1.54k stars 443 forks source link

Node Version mismatch error after comilation [Electron - 8.0.1] Please Help #284

Open digember29 opened 4 years ago

digember29 commented 4 years ago

Hello, My Node.js version is 10.19 (stable) .After the installation, when i run npm run dev - it shows error The module 'path/node_modules/@thiagoelg/node-printer/lib/node_printer.node' [1] was compiled against a different Node.js version using [1] NODE_MODULE_VERSION 76. This version of Node.js requires [1] NODE_MODULE_VERSION 70. Please try re-compiling or re-installing.

I have tried electron-rebuild way but still the error is there. Please help me fix this error. There's not much information on the doc.

eugeneli71 commented 4 years ago

the following works for me. i found it on stackoverflow. delete node_modules Run npm i -D electron-rebuild to add the electron-rebuild package Remove the node-modules folder, as well as the packages-lock.json file. Run npm i to install all modules. Run ./node_modules/.bin/electron-rebuild (.\node_modules.bin\electron-rebuild.cmd for Windows) to rebuild everything It is very important to run ./node_modules/.bin/electron-rebuild directly after npm i otherwise it did not work on my mac. reference link : https://stackoverflow.com/questions/46384591/node-was-compiled-against-a-different-node-js-version-using-node-module-versio