zapolnoch/node-tesseract-ocr

'tesseract' is not recognized as an internal or external command, operable program or batch file.

Opened this issue · 2 comments

I have added the path to environment variables , still I am getting this error while using node-tesseract-ocr library in my Node JS code.

tesseract .recognize(imgPath, config) .then((text) => { console.log("Result:", text) var words = text.split(" "); console.log(words); var code = words[0].substring(0, 6); console.log("the verification code is: " + code); return code; }) .catch((error) => { console.log(error.message) })

image

Can someone help me?

I get the same

I have added the path to environment variables , still I am getting this error while using node-tesseract-ocr library in my Node JS code.

tesseract .recognize(imgPath, config) .then((text) => { console.log("Result:", text) var words = text.split(" "); console.log(words); var code = words[0].substring(0, 6); console.log("the verification code is: " + code); return code; }) .catch((error) => { console.log(error.message) })

image

Can someone help me?

I solved it. You must first install Tesseract, if you are using Windows you can go here:
https://github.com/UB-Mannheim/tesseract/wiki

Then you must add the tesseract install folder (for me it was C:\Program Files\Tesseract-OCR) to you PATH variable. Here's how:
https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/