appium/appium-android-driver

Macos Big Sur : Opencv4nodejs and mjepg consumer installation is failing.

Closed this issue · 7 comments

Warning:

These issues are not tracked. Please create new issues in the main Appium
repository: https://github.com/appium/appium/issues/new
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/opencv4nodejs
npm ERR! command failed
npm ERR! command sh -c node ./install/install.js
npm ERR! info install using lib dir: /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/lib
npm ERR! /usr/local/lib/node_modules/opencv4nodejs/install/install.js:37
npm ERR! throw new Error('library dir does not exist: ' + libDir)
npm ERR! ^
npm ERR!
npm ERR! Error: library dir does not exist: /usr/local/lib/node_modules/opencv4nodejs/node_modules/opencv-build/opencv/build/lib
npm ERR! at Object. (/usr/local/lib/node_modules/opencv4nodejs/install/install.js:37:9)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1092:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:972:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:813:14)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
npm ERR! at node:internal/main/run_main_module:17:47

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jitu-patel/.npm/_logs/2021-04-18T11_10_47_360Z-debug.log

Jitu-Patel:~ jitu-patel$ npm -g list
/usr/local/lib
├── appium-doctor@1.16.0
├── appium@1.20.2
├── mjpeg-consumer@2.0.0
├── node-gyp@8.0.0
├── npm@7.10.0
└── opencv4nodejs@5.6.0

Please help me out from this problem.

Jitu-Patel:~ jitu-patel$ npm i -g mjpeg-consumer

changed 1 package, and audited 2 packages in 3s

found 0 vulnerabilities
Jitu-Patel:~ jitu-patel$ npm i -g mjpeg-consumer

changed 1 package, and audited 2 packages in 2s

found 0 vulnerabilities
Jitu-Patel:~ jitu-patel$ appium-doctor
info AppiumDoctor Appium Doctor v.1.16.0
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 15.14.0
info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.37.0
info AppiumDoctor ✔ HOME is set to: /Users/jitu-patel
info AppiumDoctor ✔ ANDROID_HOME is set to: /Users/jitu-patel/Library/Android/sdk
info AppiumDoctor ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
info AppiumDoctor Checking adb, android, emulator
info AppiumDoctor 'adb' is in /Users/jitu-patel/Library/Android/sdk/platform-tools/adb
info AppiumDoctor 'android' is in /Users/jitu-patel/Library/Android/sdk/tools/android
info AppiumDoctor 'emulator' is in /Users/jitu-patel/Library/Android/sdk/emulator/emulator
info AppiumDoctor ✔ adb, android, emulator exist: /Users/jitu-patel/Library/Android/sdk
info AppiumDoctor ✔ 'bin' subfolder exists under '/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home'
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
WARN AppiumDoctor ✖ opencv4nodejs cannot be found.
info AppiumDoctor ✔ ffmpeg is installed at: /usr/local/bin/ffmpeg. ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
WARN AppiumDoctor ✖ mjpeg-consumer cannot be found.
WARN AppiumDoctor ✖ set-simulator-location is not installed
WARN AppiumDoctor ✖ idb and idb_companion are not installed
WARN AppiumDoctor ✖ applesimutils cannot be found
WARN AppiumDoctor ✖ ios-deploy cannot be found
WARN AppiumDoctor ✖ bundletool.jar cannot be found
WARN AppiumDoctor ✖ gst-launch-1.0 and/or gst-inspect-1.0 cannot be found
info AppiumDoctor ### Diagnostic for optional dependencies completed, 8 fixes possible. ###
info AppiumDoctor
info AppiumDoctor ### Optional Manual Fixes ###
info AppiumDoctor The configuration can install optionally. Please do the following manually:
WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md
WARN AppiumDoctor ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'.
WARN AppiumDoctor ➜ set-simulator-location is needed to set location for Simulator. Please read https://github.com/lyft/set-simulator-location to install it
WARN AppiumDoctor ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb
WARN AppiumDoctor ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/
WARN AppiumDoctor ➜ ios-deploy is used as a fallback command to install iOS applications to real device. Please read https://github.com/ios-control/ios-deploy/ to install it
WARN AppiumDoctor ➜ bundletool.jar is used to handle Android App Bundle. Please read http://appium.io/docs/en/writing-running-appium/android/android-appbundle/ to install it
WARN AppiumDoctor ➜ gst-launch-1.0 and gst-inspect-1.0 are used to stream the screen of the device under test. Please read https://appium.io/docs/en/writing-running-appium/android/android-screen-streaming/ to install them and for more details
info AppiumDoctor
info AppiumDoctor ###
info AppiumDoctor
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!
info AppiumDoctor

Probably the mjpeg-comsuer was installed, but the doctor had an issue. appium/appium-doctor#118

For opencv4nodejs.
Probably OpenCV was failed to install on your local.
https://github.com/justadudewhohacks/opencv4nodejs

Thanks for the quick response @KazuCocoa , you are correct even opencv4nodejs is also failing. Can you please help me out from this. ^~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/opencv4nodejs/cc/tracking/MultiTracker.o] Error 1
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 (node:events:369:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/Cellar/node/15.14.0/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 v15.14.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok

@KazuCocoa What i need to do now ?

I haven't tried to install opencv4nodejs on M1 mac.
You could ask https://github.com/justadudewhohacks/opencv4nodejs community

Appium 2.0 and the image plugin no longer requires this