Installing
Closed this issue · 9 comments
I am trying to install cylon-opencv. I have already managed to build opencv on my computer but when I run the command "npm install cylon-opencv" I get errors. It tells me to tell the author that node-pre-gyp install --fallback-to-build has failed on my system. What can I do to fix this??
Last login: Mon Dec 22 22:24:43 on ttys000
RahulRajansMBP:~ Rahul$ npm install cylon-opencv
/
opencv@1.0.0 install /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv
node-pre-gyp install --fallback-to-build
[opencv] Command failed:
module.js:356
Module._extensions[extension](this, filename);
^
Error: dlopen(/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node, 1): Library not loaded: /usr/local/lib/libopencv_calib3d.2.4.dylib
Referenced from: /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node
Reason: image not found
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at [eval]:1:1
at Object. ([eval]-wrapper:6:22)
at Module._compile (module.js:456:26)
at evalScript (node.js:559:25)
at startup (node.js:80:7)
at node.js:929:3
node-pre-gyp ERR! Testing pre-built binary failed, attempting to source compile
/bin/sh: pkg-config: command not found
gyp: Call to 'pkg-config --cflags opencv' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=opencv" "--configuration=Release" "--module_name=opencv" "--version=1.0.0" "--major=1" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./lib/opencv" "--host=https://node-opencv.s3.amazonaws.com/" "--module_path=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64" "--module=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node" "--remote_path=./opencv/v1.0.0/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/" "--hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz"
gyp ERR! cwd /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --name=opencv --configuration=Release --module_name=opencv --version=1.0.0 --major=1 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./lib/opencv --host=https://node-opencv.s3.amazonaws.com/ --module_path=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64 --module=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node --remote_path=./opencv/v1.0.0/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/ --hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:766:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:833:5)
node-pre-gyp ERR! System Darwin 14.0.0
node-pre-gyp ERR! command "node" "/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv
node-pre-gyp ERR! node -v v0.10.35
node-pre-gyp ERR! node-pre-gyp -v v0.5.31
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --name=opencv --configuration=Release --module_name=opencv --version=1.0.0 --major=1 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./lib/opencv --host=https://node-opencv.s3.amazonaws.com/ --module_path=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64 --module=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node --remote_path=./opencv/v1.0.0/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/ --hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz' (1)
npm ERR! opencv@1.0.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv@1.0.0 install script.
npm ERR! This is most likely a problem with the opencv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls opencv
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "cylon-opencv"
npm ERR! cwd /Users/Rahul
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
RahulRajansMBP:~ Rahul$
@Slickboy what version of opencv are you running? what OS are you on?
It seems you are on OSX, it might be that you have a newer OpenCV version than the one used to create the pre compiled binaries. It could be that version is not supported by node-opencv yet.
This is what I do to install OpenCV in OSX in order the be able to create our binaries. Maybe you can uninstall and install using brew
to ensure the versions are the same:
brew tap homebrew/science
brew update
brew install opencv
npm install opencv
Let me know how it goes.
For the first comment.... Im using "opencv 2.4-2.10" ... not sure what that means. Im on OS X 10.10.1 (Yosemite)
How do I uninstall opencv?
ok Im reinstalling using brew (I haven't uninstalled the previous one though). Ill let you know when it is done.
ok same issue as before
RahulRajansMBP:~ Rahul$ npm install cylon-opencv
\
opencv@1.0.0 install /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv
node-pre-gyp install --fallback-to-build
[opencv] Command failed:
module.js:356
Module._extensions[extension](this, filename);
^
Error: dlopen(/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node, 1): Library not loaded: /usr/local/lib/libopencv_calib3d.2.4.dylib
Referenced from: /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node
Reason: image not found
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at [eval]:1:1
at Object. ([eval]-wrapper:6:22)
at Module._compile (module.js:456:26)
at evalScript (node.js:559:25)
at startup (node.js:80:7)
at node.js:929:3
node-pre-gyp ERR! Testing pre-built binary failed, attempting to source compile
CXX(target) Release/obj.target/opencv/src/init.o
CXX(target) Release/obj.target/opencv/src/Matrix.o
../src/Matrix.cc:1273:22: warning: address of stack memory associated with local
variable 'ret' returned [-Wreturn-stack-address]
return (cv::Rect_) &ret;
^~~
1 warning generated.
CXX(target) Release/obj.target/opencv/src/OpenCV.o
CXX(target) Release/obj.target/opencv/src/CascadeClassifierWrap.o
../src/CascadeClassifierWrap.cc:106:9: warning: private field 'sleep_for' is not
used [-Wunused-private-field]
int sleep_for;
^
1 warning generated.
CXX(target) Release/obj.target/opencv/src/Contours.o
CXX(target) Release/obj.target/opencv/src/Point.o
CXX(target) Release/obj.target/opencv/src/VideoCaptureWrap.o
CXX(target) Release/obj.target/opencv/src/CamShift.o
CXX(target) Release/obj.target/opencv/src/HighGUI.o
CXX(target) Release/obj.target/opencv/src/FaceRecognizer.o
CXX(target) Release/obj.target/opencv/src/BackgroundSubtractor.o
CXX(target) Release/obj.target/opencv/src/Constants.o
SOLINK_MODULE(target) Release/opencv.node
clang: error: no such file or directory: 'OpenCL'
clang: error: no such file or directory: 'AppKit'
clang: error: no such file or directory: 'QuartzCore'
clang: error: no such file or directory: 'QTKit'
clang: error: no such file or directory: 'Cocoa'
make: *_* [Release/opencv.node] 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:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=opencv" "--configuration=Release" "--module_name=opencv" "--version=1.0.0" "--major=1" "--runtime=node" "--node_abi=node-v11" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./lib/opencv" "--host=https://node-opencv.s3.amazonaws.com/" "--module_path=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64" "--module=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node" "--remote_path=./opencv/v1.0.0/Release/" "--package_name=node-v11-darwin-x64.tar.gz" "--staged_tarball=build/stage/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz" "--hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/" "--hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz"
gyp ERR! cwd /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --name=opencv --configuration=Release --module_name=opencv --version=1.0.0 --major=1 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./lib/opencv --host=https://node-opencv.s3.amazonaws.com/ --module_path=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64 --module=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node --remote_path=./opencv/v1.0.0/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/ --hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:766:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:833:5)
node-pre-gyp ERR! System Darwin 14.0.0
node-pre-gyp ERR! command "node" "/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/Rahul/node_modules/cylon-opencv/node_modules/opencv
node-pre-gyp ERR! node -v v0.10.35
node-pre-gyp ERR! node-pre-gyp -v v0.5.31
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild --name=opencv --configuration=Release --module_name=opencv --version=1.0.0 --major=1 --runtime=node --node_abi=node-v11 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./lib/opencv --host=https://node-opencv.s3.amazonaws.com/ --module_path=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64 --module=/Users/Rahul/node_modules/cylon-opencv/node_modules/opencv/build/opencv/v1.0.0/Release/node-v11-darwin-x64/opencv.node --remote_path=./opencv/v1.0.0/Release/ --package_name=node-v11-darwin-x64.tar.gz --staged_tarball=build/stage/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz --hosted_path=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/ --hosted_tarball=https://node-opencv.s3.amazonaws.com/opencv/v1.0.0/Release/node-v11-darwin-x64.tar.gz' (1)
npm ERR! opencv@1.0.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the opencv@1.0.0 install script.
npm ERR! This is most likely a problem with the opencv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls opencv
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "cylon-opencv"
npm ERR! cwd /Users/Rahul
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
You probably need to uninstall your older version, the instructions should be in the README file inside the folder where you built opencv.
I suggest uninstalling all versions of opencv first, then install using brew and try again. I will check the versions for which node-opencv was compiled in the meantime.
This might be helpful, but you should check the instructions in the README.
http://stackoverflow.com/questions/8550906/how-to-uninstall-opencv-on-mac-10-6-8
http://stackoverflow.com/questions/19707468/installing-opencv-2-4-2-on-mac-os-x-10-9-mavericks
Did you have any luck with the instaltion of opencv and testing this? I'm closing this issue.
Let us know if you were able (or not) to make it work.