Original error: 'opencv4nodejs' module is required to use OpenCV features

Greetings everyone!
I am trying to lunch a simple test with Appium’s image recognition, but every time I do that, I am getting an error:

OpenQA.Selenium.WebDriverException : An unknown server-side error occurred while processing the command. Original error: ‘opencv4nodejs’ module is required to use OpenCV features. Please install it first (‘npm i -g opencv4nodejs’) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.

I think I tried every possible way that I could come up with to install and reinstall opencv4nodejs, but I still get this error. Among them was downloading opencv 4 manually, adding all required properties to the global variables and then running npm i -g opencv4nodejs.

I could see opencv4nodejs files being added to my node_modules folders and appium-doctor reports that the opencv4nodejs module is installed, but when I am trying to run my test, it seems appium doesn’t actually see installed libraries. Perhaps some additional steps should be done, like pointing my project to the installed opencv4nodejs folder, or maybe linking opencv4nodejs to the appium node_modules folder?

My OC is Windows 10 and I am running Appium desktop version (tried Appium CLI too after some googling and finding out that desktop has problems with opencv4nodejs module, but that didn’t resolve my problem).

Any help will be appreciated and I will gladly provide any screenshots or other additional information if that is needed.

Best Regards,

Have you install the OpenCV with the brew. As far as I’m aware the OpenCV js lib is just a wrapper to access the underlying OpenCV library.
please refer https://github.com/justadudewhohacks/opencv4nodejs#macosx.

Hey @pr4bh4sh It seems that brew is a macos only application, so I didn’t use it (there seems to be a possibility to use it through Windows 10 Linux Subsystem though, so I could give it a try).

I did install OpenCV through Chocolatey for Windows 10, which seems to be Windows 10’s alternative for brew.

Did it work after installing the OpenCV?

Sadly no. What I did was running the install command through choco, added needed global variables and then ran the npm install -g opencv4nodejs command.

Now I suspect that I may be missing some additional steps needed to install the OpenCV on my pc. Could you maybe point me in the right direction if that’s actually the case, please?

@Bogdan_Ignatovich I am facing the same issue on macOS , were you able to resolve this issue?