new mecab returning empty object
I was trying to utilize this library but when I instanciated MeCab it only returned an empty object, What's up with the library? Isn't it working anymore?
Here's a example: https://replit.com/@AmodeusR/Mecab-library-test
same issue +1
I apologize for the delayed response.
It’s possible that mecab-ipadic is not installed. Could you check on the console if the regular mecab command returns results correctly?
I don't even remember exactly what was the problem, but at least trying it now, it throws an error saying mecab was not found. How do I get it?
Error: Command failed: echo これがただの簡単な日本語の文ですよ | mecab
/bin/sh: 1: mecab: not found
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1104:16)
at Socket.<anonymous> (node:internal/child_process:456:11)
at Socket.emit (node:events:518:28)
at Pipe.<anonymous> (node:net:343:12) {
code: 127,
killed: false,
signal: null,
cmd: 'echo これがただの簡単な日本語の文ですよ | mecab'
}
Thank you for the information. The error seems to come from the MeCab command not being accessible. Please install MeCab according to your OS (e.g., on macOS: brew install mecab and brew install mecab-ipadic) and ensure the path is set. If you’d rather not set the path globally, you can specify it directly in your code:
var MeCab = new require('mecab-async');
var mecab = new MeCab();
mecab.command = '/usr/local/bin/mecab';
Thank you for the information. The error seems to come from the MeCab command not being accessible. Please install MeCab according to your OS (e.g., on macOS: brew install mecab and brew install mecab-ipadic) and ensure the path is set. If you’d rather not set the path globally, you can specify it directly in your code:
Where can I download it for Windows? I tried going to Taku's MeCab website but the link is broken.