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

libxmljs and jvm-npm #39

Open
joelbloch opened this issue Jul 27, 2017 · 0 comments
Open

libxmljs and jvm-npm #39

joelbloch opened this issue Jul 27, 2017 · 0 comments

Comments

@joelbloch
Copy link

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!

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

1 participant