Open gamingredpandas opened 2 years ago
I have the same problems.
Experiencing the same issue on MacOS using node version 16.13.1
.
Please try that : in am admin power shell
choco install cmake -y
in you user cmd / powershell
cd D:\projects\webcam
npm i -g node-gyp
npm i @u4/opencv4nodejs
echo build nodejs
node .\node_modules\.bin\build-opencv --help
node .\node_modules\.bin\build-opencv --version 4.5.4 build
The errors messages of this version are way cleaner, and the build should works fine with nodeJS 16
PS: do not use 4.5.5 on MacOS. PS: the original version do not work with Visual Studio 2019.
In my situation, the root cause is that it cannot auto build (or even install) the opencv-build
package.
When I try to install opencv-build
by executing npm i opencv-build
, it stucked on reify:... Completed in XXXms
, then I found this thread.
After downgrade npm by npm i -g npm@6
, then try again, everything works like a charm.
I was having issues with this as well. Downgrading to Node 14 worked for me.
In my situation, the root cause is that it cannot auto build (or even install) the
opencv-build
package.When I try to install
opencv-build
by executingnpm i opencv-build
, it stucked onreify:... Completed in XXXms
, then I found this thread.After downgrade npm by
npm i -g npm@6
, then try again, everything works like a charm.
Thanks for the information, I also faced the same issue, and it worked after downgrading the npm version to 6
Hi, Great news for those people that do not want to build their OpenCV: I published @u4/opencv4nodejs V 6.2.4 today,
This version autodetects the common setup path for Brew on Mac, Chocolatey on Windows, and Apt on Linux.
Windows:
choco install opencv
Mac:
brew install opencv
debian:
apt -y install libopencv-contrib-dev libopencv-dev
just define environment variable: OPENCV4NODEJS_DISABLE_AUTOBUILD=1
And your prebuild OpenCV will be used.
You may need to call:
npx build-opencv rebuild
or
npx build-opencv --nobuild rebuild
(if you do not define OPENCV4NODEJS_DISABLE_AUTOBUILD variable)
npm i -g npm@6
tried this and i got pass the error library dir does not exist
but im getting this error now
[ 50%] Built target libprotobuf
make: *** [all] Error 2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv-build@0.1.9 install: `node ./install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv-build@0.1.9 install script.
Description
I am trying to use opencv4nodejs to capture my webcam, but I am not able to install it. I tried a lot of other things and other ways to install opencv4nodejs, but none were successful, so I will just post the result of an auto build.
Error Message
Error: library dir does not exist: D:/projects/webcam/node_modules/opencv-build/opencv/build/lib/Release
Auto Build - Full Error Log
npm install --save opencv4nodejs npm WARN cleanup Failed to remove some directories [ npm WARN cleanup [ npm WARN cleanup 'D:\projects\webcam\node_modules', npm WARN cleanup [Error: EBUSY: resource busy or locked, rmdir 'D:\projects\webcam\node_modules\opencv-build'] { npm WARN cleanup errno: -4082, npm WARN cleanup code: 'EBUSY', npm WARN cleanup syscall: 'rmdir', npm WARN cleanup path: 'D:\projects\webcam\node_modules\opencv-build' npm WARN cleanup } npm WARN cleanup ] npm WARN cleanup ] npm ERR! code 1 npm ERR! path D:\projects\webcam\node_modules\opencv4nodejs npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./install/install.js npm ERR! info install using lib dir: D:/projects/webcam/node_modules/opencv-build/opencv/build/lib/Release npm ERR! D:\projects\webcam\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: D:/projects/webcam/node_modules/opencv-build/opencv/build/lib/Release npm ERR! at Object. (D:\projects\webcam\node_modules\opencv4nodejs\install\install.js:37:9)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1097:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:975:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR! at node:internal/main/run_main_module:17:47
npm ERR!
npm ERR! Node.js v17.3.0
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\\AppData\Local\npm-cache_logs\2022-01-03T14_55_06_355Z-debug-0.log
OpenCV version : 5.6.0
With OpenCV-contrib? (extra modules): no
OS: Windows 10