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

NODE_MODULE_VERSION error #185

Open
pamarti opened this issue Mar 27, 2018 · 9 comments
Open

NODE_MODULE_VERSION error #185

pamarti opened this issue Mar 27, 2018 · 9 comments

Comments

@pamarti
Copy link

pamarti commented Mar 27, 2018

/node_modules/node-expat/build/Release/node_expat.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).

node-expat : 2.3.16
node: 8.10
npm: 5.6
electron: 1.8.4

I also used electron-rebuild to build the package to new target node version
I also used node-gyp to rebuild node-expat. Nothing helped.

Any ideas to fix this issue?

@8BitJonny
Copy link

Same Issue here

@drmrbrewer
Copy link

Same here. Any solution to this? It occurred after I upgrade from node 8.12.0 to node 10.13.0. I am using node-expat via xml2json. The error I get is when I run my node app:

/root/workspace/myapp/node_modules/bindings/bindings.js:88
		throw e
		^

Error: The module '/root/workspace/myapp/node_modules/node-expat/build/Release/node_expat.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
	at Object.Module._extensions..node (module.js:682:18)
	at Module.load (module.js:566:32)
	at tryModuleLoad (module.js:506:12)
	at Function.Module._load (module.js:498:3)
	at Module.require (module.js:597:17)
	at require (internal/module.js:11:18)
	at bindings (/root/workspace/myapp/node_modules/bindings/bindings.js:81:44)
	at Object.<anonymous> (/root/workspace/myapp/node_modules/node-expat/lib/node-expat.js:4:32)
	at Module._compile (module.js:653:30)
	at Object.Module._extensions..js (module.js:664:10)

@catin-black
Copy link

+1

@lfuelling
Copy link

lfuelling commented Mar 20, 2019

I have the same problem. I tried building on 8.x, 10.x and 11.x. I am also using node-expat only as dependency of xml2json.

Error: The module 'node_modules/node-expat/build/Release/node_expat.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 67. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at bindings (node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (node_modules/node-expat/lib/node-expat.js:4:32)

EDIT: I solved my problem. Apparently electron sets this value higher than the current latest. I had to add electron-rebuild as postinstall hook which in turn compiled node-expat with the correct version.

@Sashlyn
Copy link

Sashlyn commented Sep 18, 2019

Has anyone found a solution to this outside of electron?
I've got the exact same issue as the OP but running on an Ubuntu server.

@hefc2016
Copy link

hefc2016 commented Mar 1, 2020

I have same error with node-expat.

<Error: The module '/home/hefc/GIT/xviz/examples/converters/kitti/node_modules/node-expat/build/Release/node_expat.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 46. This version of Node.js requires
NODE_MODULE_VERSION 67. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).>

Could anyone who fixed this issue share the solution ouside elelctron?

@sriramtorvi
Copy link

sriramtorvi commented Jul 8, 2020

I had the same issue
Downgrading the node version and running npm rebuild helped me.

@miklcct
Copy link

miklcct commented May 14, 2024

same issue here

@miklcct
Copy link

miklcct commented May 14, 2024

Running npm rebuild helped me, but what is the equivalent on yarn?

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

No branches or pull requests

9 participants