简体   繁体   中英

Node.js REPL eval

I am trying to implement an evaluation into a Node.JS REPL. I am getting the error TypeError: Property 'eval' of object #<REPLServer> is not a function . Here is my source code:

repl.start("> ", socket, socket, true, function(cmd, context, filename, callback){
etc...

repl.start() takes an object with those options, not individual arguments:

eg (note the curly brackets)

repl.start({
  prompt: "node via stdin> ",
  input: process.stdin,
  output: process.stdout
});

see the example at: http://nodejs.org/docs/v0.8.4/api/repl.html#repl_repl_start_options

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM