Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install - The module was compiled against a different Node.js version #301

Open
Slos opened this issue Nov 7, 2020 · 3 comments
Open

Comments

@Slos
Copy link

Slos commented Nov 7, 2020

Looks like this package is always being compiled against the wrong node version, what is going on?

This printer packages has been annoying me for the past 3 years, I don't know what I am doing wrong but I always have problems with this package.

Out of my 50+ dependencies this is the only one which is busting my balls, aaarrgghhhhg!

nvm use 11.2.0
Now using node v11.2.0 (npm v6.4.1)
node -v
v11.2.0
which node
/Users/*******/.nvm/versions/node/v11.2.0/bin/node
npm install
node app.js
Error: The module '/Users/**********/dev/zdeapp/node_modules/printer/lib/node_printer.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 79. This version of Node.js requires NODE_MODULE_VERSION 67. Please try re-compiling or re-installing the module (for instance, using npm rebuildornpm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:751:18) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Module.require (internal/modules/cjs/loader.js:658:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (/Users/********/dev/zdeapp/node_modules/printer/lib/printer.js:10:22) at Module._compile (internal/modules/cjs/loader.js:722:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10) at Module.load (internal/modules/cjs/loader.js:620:32)

now trying with another node version:

sudo rm -rf node_modules/
nvm use v14.9.0
node -v
v14.9.0
npm install
node app.js
Error: The module '/Users/filipschlosser/dev/zdeapp/node_modules/printer/lib/node_printer.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 79. This version of Node.js requires NODE_MODULE_VERSION 83. Please try re-compiling or re-installing the module (for instance, using npm rebuildornpm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:1126:18) at Module.load (internal/modules/cjs/loader.js:940:32) at Function.Module._load (internal/modules/cjs/loader.js:781:14) at Module.require (internal/modules/cjs/loader.js:964:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (/Users/filipschlosser/dev/zdeapp/node_modules/printer/lib/printer.js:10:22) at Module._compile (internal/modules/cjs/loader.js:1075:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1096:10) at Module.load (internal/modules/cjs/loader.js:940:32) at Function.Module._load (internal/modules/cjs/loader.js:781:14)

@henriquegranatto
Copy link

I am experiencing the same problem here. I've tried all the possible solutions I found on the internet and nothing worked.

I mainly see solutions like this: https://stackoverflow.com/questions/46384591/node-was-compiled-against-a-different-node-js-version-using-node-module-versio

But it never works.

@hgarcia
Copy link

hgarcia commented Dec 17, 2020

version 0.4.0 have been compiled against node v13.3.0 that solved the problem for me.

@shabanbx
Copy link

latest version of electron gives this problem so the solution is
downgrade electron to 6.1.7
also downgrade global electron to v 6.1.7
then

./node_modules/.bin/electron-rebuild

If you have trouble on Windows, try:

.\node_modules.bin\electron-rebuild.cmd

then your printer will run fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants