Is there an alternative for Opencv4nodejs?

Is there an alternative for opencv4nodejs ?

I have tried everything to install opencv4nodejs on my Mac machine but it does not seems to be working and fails after 55% build.

So i was just wondering if there is an alternative for it to achieve with Appium?

Appium only works with that module. I was using the following CLI command to successfully build opencv4nodejs on macOS 11.4:

OPENCV4NODEJS_AUTOBUILD_FLAGS=-DBUILD_opencv_text=OFF npm i -g opencv4nodejs

@mykola-mokhnach: I tried the command mentioned above on my macOS 11.4, but getting below mentioned error:

gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:375:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–jobs” “max”
gyp ERR! cwd /usr/local/lib/node_modules/opencv4nodejs
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

@mykola-mokhnach: I tried uninstalling Node and installing the latest version, also installed appium 1.21.0.

After this i tried running your command and opencv4nodejs installed successfully without any errors but still when i am trying to run my Appium tests i get below mentioned error.

"org.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. "

So i tried to link the opencv4nodejs module to appium by going to the appium folder path under node_modules and running below mentioned command:

npm ls -g opencv4nodejs --depth=0 && npm link opencv4nodejs

but still getting same error while running the tests.

i have installed appium and opencv4nodejs globally using -g option. Could this be a module linking issue?

I think it might not work if you use Appium Desktop, - only with the one installed from NPM

I am using appium cli not appium desktop.

Check the documentation on Node modules resolution. Perhaps, it is just necessary to either link opencv4nodejs to a proper folder or add its root folder to NODE_PATH environment variable

Got it resolved by switching the node version to 14. Thanks for help.

What was the previous Node version?

The earlier version was Node 16

please advise me how you resolve it >> i also made my node 14 but i have the same issue