Cannot find module '/build/Release/nodejavabridge_bindings.node'
The module seems to be installed properly and running npm test shows everything is ok. When I build, webpack gives only one warning:
Critical dependencies:
21:15-34 the request of a dependency is an expression
@ ./~/java/lib/nodeJavaBridge.js 21:15-34
However, the script doesn't run and gives:
Uncaught Error: Cannot find module '/build/Release/nodejavabridge_bindings.node'
You may want to look at this http://stackoverflow.com/questions/32832179/using-webpack-with-nodejs-native-modules and more specifically this http://jlongster.com/Backend-Apps-with-Webpack--Part-I to exclude native modules from webpack.
Try something like...
externals: {
'node_modules/java/build/Release/nodejavabridge_bindings.node': 'java'
}
Has anyone had luck solving this?
change
var bindings = require(binaryPath);
to
var bindings = __non_webpack_require__(binaryPath);
And you need to copy jvm.dll & classes.jsa to current directory.
@coco-napky Do you found any solution on how to make it work? i am quessing @joeferner will never respond :P