hiteshjoshi / node-stanford-corenlp

A simple node.js wrapper for Stanford CoreNLP.
Other
75 stars 35 forks source link

Why does the Async mode example return "[Error: Load a pipeline first.] undefined" #20

Closed person666 closed 8 years ago

person666 commented 8 years ago

The Async mode example returns [Error: Load a pipeline first.] undefined with everything set up as it should be. How can I get it working?

hiteshjoshi commented 8 years ago

https://github.com/hiteshjoshi/node-stanford-corenlp/issues/8#issuecomment-132071560

person666 commented 8 years ago
var NLP = require('stanford-corenlp');

var coreNLP = new NLP.StanfordNLP({

    "nlpPath":"./corenlp",
    "version":"3.6.0"

},function(err) {
  coreNLP.process('This is so good.', function(err, result) {
    console.log(err,JSON.stringify(result));
  });
});

after updating to latest commit returns

fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

TypeError: path must be a string
    at TypeError (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at getProperties (/home/user/code/stanford-corenlp-test/node_modules/stanford-corenlp/lib/util.js:4:13)
    at Object.exports.setProperties (/home/user/code/stanford-corenlp-test/node_modules/stanford-corenlp/lib/util.js:16:3)
    at /home/user/code/stanford-corenlp-test/node_modules/stanford-corenlp/lib/StanfordNLP.js:77:16
hiteshjoshi commented 8 years ago

try now

person666 commented 8 years ago

I ran npm install https://github.com/hiteshjoshi/node-stanford-corenlp.git then tried again still getting the error. I also tried reinstalling java the npm package.

qrpike commented 8 years ago

I too am getting the same error. Any advice?

Ricsie commented 7 years ago

I have the same error on Async example code. How can I solve it? I'm Really stuck there...

rneha725 commented 7 years ago

I am stuck with the same code!!

hiteshjoshi commented 7 years ago

https://github.com/hiteshjoshi/node-stanford-corenlp/issues/8#issuecomment-132071560

Ricsie commented 7 years ago

the problem is we all are using the async mode. even the original quetion states async mode is problematic. why are you keep linking us to the comment "use async mode"? if the async mode doesnt work?

hiteshjoshi commented 7 years ago

my bad... can any of you tell, which version of core NLP are you using?

Ricsie commented 7 years ago

thank you for your fast response. Im using stanford-corenlp-full-2015-12-09.zip