peterbraden / node-opencv

OpenCV Bindings for node.js
MIT License
4.37k stars 858 forks source link

npm install opencv fails #642

Closed salimazeri closed 5 years ago

salimazeri commented 5 years ago

From yesterday I am trying to deal with the problem in the opencv installation, I am using npm install opencv in the appropriate directory. I tried a few solutions from this site, nothing worked for me

nodejs -v: v8.10.0 npm -v: 6.5.0-next.0

That's my output for 'npm install opencv' :

npm WARN deprecated cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.

> opencv@6.0.0 install /home/salim/Pulpit/helper/node_modules/opencv
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for opencv@6.0.0 and node@11.6.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for opencv@6.0.0 and node@11.6.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp) 
make: Wejście do katalogu '/home/salim/Pulpit/helper/node_modules/opencv/build'
make: Wejście do katalogu '/home/salim/Pulpit/helper/node_modules/opencv/build'
  CXX(target) Release/obj.target/opencv/src/init.o
  CXX(target) Release/obj.target/opencv/src/init.o
rm: nie można usunąć './Release/.deps/Release/obj.target/opencv/src/init.o.d.raw': Nie ma takiego pliku ani katalogu
opencv.target.mk:120: recipe for target 'Release/obj.target/opencv/src/init.o' failed
make: *** [Release/obj.target/opencv/src/init.o] Error 1
make: Opuszczenie katalogu '/home/salim/Pulpit/helper/node_modules/opencv/build'
  CXX(target) Release/obj.target/opencv/src/Matrix.o
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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.15.0-43-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64/opencv.node" "--module_name=opencv" "--module_path=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64"
gyp ERR! cwd /home/salim/Pulpit/helper/node_modules/opencv
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
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 build --fallback-to-build --module=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64/opencv.node --module_name=opencv --module_path=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/salim/Pulpit/helper/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:978:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Linux 4.15.0-43-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/salim/Pulpit/helper/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/salim/Pulpit/helper/node_modules/opencv
node-pre-gyp ERR! node -v v11.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
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 build --fallback-to-build --module=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64/opencv.node --module_name=opencv --module_path=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64' (1)
../src/Matrix.cc:2:10: fatal error: Matrix.h: Nie ma takiego pliku ani katalogu
compilation terminated.
opencv.target.mk:120: recipe for target 'Release/obj.target/opencv/src/Matrix.o' failed
make: *** [Release/obj.target/opencv/src/Matrix.o] Error 1
make: Opuszczenie katalogu '/home/salim/Pulpit/helper/node_modules/opencv/build'
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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.15.0-43-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64/opencv.node" "--module_name=opencv" "--module_path=/home/salim/Pulpit/helper/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-linux-x64"
gyp ERR! cwd /home/salim/Pulpit/helper/node_modules/opencv
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN opencv@6.0.0 had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.
npm WARN helper@1.0.0 No description
npm WARN helper@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv@6.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the opencv@6.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/salim/.npm/_logs/2019-01-12T23_18_05_308Z-debug.log
d3v-null commented 5 years ago

Not sure why this is failing for you, but your node version according to gyp is node -v v11.6.0 not 8

iarambula commented 5 years ago

This worked for me: npm install opencv4nodejs --save

jasonpolites commented 5 years ago

Same for me.. looks like maybe a bucket permission?

node-pre-gyp ERR! Tried to download(403): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v64-darwin-x64.tar.gz