node-java icon indicating copy to clipboard operation
node-java copied to clipboard

Build with NODE_MODULE_VERSION 72, requires NODE_MODULE_VERSION 75, nodejavabridge_bindings

Open wjs4572 opened this issue 5 years ago • 4 comments

Getting the following error:

Error: The module '_<PROJECT_DIR>_/node_modules\java\build\Release\nodejavabridge_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 75. Please try re-compiling or re-installing

I did try the following, with no luck:

node-gyp configure --target=$(node --version)
node-gyp rebuild
node-gyp clean

and

npm install
npm audit fix
npm test

wjs4572 avatar Sep 02 '20 15:09 wjs4572

This appears to have been a generated when a build directory was added to the project root. I am not sure when or how that was added through getting this to build.

wjs4572 avatar Sep 02 '20 17:09 wjs4572

This appears to be still an issue, even with no build directory in the root project.

wjs4572 avatar Sep 02 '20 19:09 wjs4572

Not entirely sure about your situation but I have seen this issue if you do npm install in one machine with a specific nodejs version then move the project entirely to a different machine with a different nodejs version. Make sure the build and run happens on the same nodejs version, that could be the culprit.

ChrisTomAlx avatar Mar 04 '21 06:03 ChrisTomAlx

I have a similar issue updated to 2024

Using from a VSCode extension and failing when running it in debug mode:

Activating extension '...' failed: The module '\\?\c:\...\node_modules\node-jmx\node_modules\java\build\Release\nodejavabridge_bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 115. This version of Node.js requires
NODE_MODULE_VERSION 123. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`)..

I've tried to rebuild and reinstall with no luck

hiebra avatar Sep 11 '24 07:09 hiebra