simbit icon indicating copy to clipboard operation
simbit copied to clipboard

error when trying to run

Open mbaniasad opened this issue 7 years ago • 1 comments

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

mbaniasad avatar Jun 17 '17 14:06 mbaniasad

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.

haasn avatar Jun 29 '17 05:06 haasn