You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create a javascript with the following 2 lines:
load('./jvm-npm.js'); require('libxmljs');
I instantiate a nashorn script engine and execute the script:
FileReader script = new FileReader(scriptName); ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine jsEngine = factory.getEngineByName("nashorn"); jsEngine.eval(script);
I get the following exception:
Cannot load module ./lib/bindings LOAD_ERROR Cannot load module /Users/joelbloch/node_modules/libxmljs LOAD_ERROR javax.script.ScriptException: TypeError: require("bindings") is not a function in /jvm-npm.js at line number 108 at column number 8
Thanks!
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to import libxmljs module into a javascript script executed by the nashorn script engine on the jvm.
I downloaded the jvm-npm.js script from https://github.com/nodyn/jvm-npm. I installed libxmljs using npm.
I create a javascript with the following 2 lines:
load('./jvm-npm.js'); require('libxmljs');
I instantiate a nashorn script engine and execute the script:
FileReader script = new FileReader(scriptName); ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine jsEngine = factory.getEngineByName("nashorn"); jsEngine.eval(script);
I get the following exception:
Cannot load module ./lib/bindings LOAD_ERROR Cannot load module /Users/joelbloch/node_modules/libxmljs LOAD_ERROR javax.script.ScriptException: TypeError: require("bindings") is not a function in /jvm-npm.js at line number 108 at column number 8
Thanks!
The text was updated successfully, but these errors were encountered: