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

error when trying to run #2

Open
mbaniasad opened this issue Jun 17, 2017 · 1 comment
Open

error when trying to run #2

mbaniasad opened this issue Jun 17, 2017 · 1 comment

Comments

@mbaniasad
Copy link

me@mysys:simbit(master)$ node sim.js 
/home/me/Documents/uni/Thesis/tmp/simbit/goog/bootstrap/nodejs.js:69
  process.binding('evals').NodeScript.runInThisContext.call(
          ^

Error: No such module: evals
    at Error (native)
    at nodeGlobalRequire (/home/me/Documents/uni/Thesis/tmp/simbit/goog/bootstrap/nodejs.js:69:11)
    at Object.<anonymous> (/home/me/Documents/uni/Thesis/tmp/simbit/goog/bootstrap/nodejs.js:77:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
me@mysys:simbit(master)$ node --version
v6.11.0
@haasn
Copy link

haasn commented Jun 29, 2017

For anybody else wondering, this patch fixes it:

diff --git a/goog/bootstrap/nodejs.js b/goog/bootstrap/nodejs.js
index 0762037..4c87c2c 100755
--- a/goog/bootstrap/nodejs.js
+++ b/goog/bootstrap/nodejs.js
@@ -66,7 +66,7 @@ global.CLOSURE_IMPORT_SCRIPT = function(src) {
 
 // Declared here so it can be used to require base.js
 function nodeGlobalRequire(file) {
-  process.binding('evals').NodeScript.runInThisContext.call(
+  require('vm').runInThisContext.call(
       global, fs.readFileSync(file), file);
 }
 

It may not be the most proper fix in existence, but it's a fix nonetheless.

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

2 participants