I am trying to use the execSync package to get synchronous shell functionality. Although I initially had problems due to the lack of the binding.node file, I solved it by running node-gyp in proper execSync directories. Now, I can call execSync functions within node without any problems.
However, when I try to use the functions from within meteor, I get the following error:
Running on: http://localhost:3000/
/usr/lib/meteor/bin/node: symbol lookup error: /home/onur/node_modules/execSync/node_modules/ffi/node_modules/ref/build/Release/binding.node: undefined symbol: _ZNK2v85Value6IsNullEv
Exited with code: 127
Your application is crashing. Waiting for file change.
Note:
A quick inspection over the net showed that the symbol belongs to the V8 library.
The Code
I define the following in Meteor.methods.
getpuzzle: function (clu, lo, hi) {
var require = _meteor_bootstrap__.require;
var exec = require('execSync');
var sudoku_str = exec.stdout(path_sudoku_gen+" "+clu+" "+lo+" "+hi);
console.log(sudoku_str);
return sudoku_str;
}
I am trying to figure out the interaction between the server and client. Basically, I'm trying to do this. The function on the client side requires a string that is returned by a python script executed on the server side. I tried a dirty hack using a global variable, but it still did not matter because the script is run asynchronously. Can I do this without synchronous execution? I cannot fully grasp the model for client-server interaction, so if there is a right way to do it, feel free to correct me.
Since you are not showing your code, I am assuming that your require lines are failing. Instead of the standard node.js require you have to use the Meteor wrapper
var require = __meteor_bootstrap__.require;
var path = require('path')