Hi there,
I tried following the instructions and couldn't get it to build with yarn add opencv
There is a very long build output with lots of deprecation warnings, but some errors that stood out were:
../src/Matrix.cc:500:53: error: no matching member function for call to 'NewInstance'
Nan::New(Matrix::constructor)->GetFunction()->NewInstance();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:4108:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:4105:44: note: candidate function not viable: requires 3 arguments, but 0 were provided
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
^
../src/Matrix.cc:672:62: error: no matching member function for call to 'NewInstance'
v8::Local < v8::Object > actualBuffer = bufferConstructor->NewInstance(3,
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../src/Matrix.cc:708:61: error: no matching member function for call to 'NewInstance'
v8::Local<v8::Object> actualBuffer = bufferConstructor->NewInstance(3, constructorArgs);
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../src/Matrix.cc:1222:27: error: no matching member function for call to 'ToInt32'
int flipCode = info[0]->ToInt32()->Value();
~~~~~~~~~^~~~~~~
../src/Matrix.cc:1466:81: error: no matching member function for call to 'NewInstance'
Local<Object> conts_to_return= Nan::New(Contour::constructor)->GetFunction()->NewInstance();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../src/Matrix.cc:1662:26: error: no matching member function for call to 'ToNumber'
float angle = info[0]->ToNumber()->Value();
~~~~~~~~~^~~~~~~~
Full output:
yarn add opencv
yarn add v1.12.3
warning ../../../package.json: No license field
[1/4] 🔍 Resolving packages...
warning opencv > node-pre-gyp > hawk > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning opencv > node-pre-gyp > hawk > sntp > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning opencv > node-pre-gyp > hawk > cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.
warning opencv > node-pre-gyp > hawk > boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
warning opencv > node-pre-gyp > hawk > cryptiles > boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
warning opencv > node-pre-gyp > hawk > boom > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
error /Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@11.5.0 | darwin | x64
node-pre-gyp info check checked for "/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64/opencv.node" (not found)
node-pre-gyp http GET https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-darwin-x64.tar.gz
node-pre-gyp http 403 https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(403): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for opencv@6.0.0 and node@11.5.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v67-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for opencv@6.0.0 and node@11.5.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
gypgyp info it worked if it ends with ok
info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@11.5.0 | darwin | x64
gyp info using node-gyp@3.8.0
gyp info using node@11.5.0 | darwin | x64
gyp info gypok
info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@11.5.0 | darwin | x64
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@11.5.0 | darwin | x64
gyp info spawngyp /usr/bin/python
info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp gypinfo spawn argsinfo 'binding.gyp',
gypspawn args [ '/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
infogyp spawn args '-f',
infogyp spawn argsinfo 'binding.gyp',
spawn argsgyp 'make',
gypinfo info spawn argsspawn args '-f',
'-I',
gypgyp infoinfo spawn args '/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/config.gypi',
spawn argsgyp 'make',
infogyp spawn args '-I',
infogyp spawn argsinfo '-I',
gypspawn args '/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gypinfo infospawn args '/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/config.gypi',
spawn argsgyp '-I',
gyp infoinfo spawn argsspawn args '-I',
'/Users/derwent/.node-gyp/11.5.0/include/node/common.gypi',
gypgyp infoinfo spawn args '-Dlibrary=shared_library',
spawn argsgyp '/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
infogyp infospawn args '-Dvisibility=default',
spawn argsgyp '-I',
info gypspawn args '-Dnode_root_dir=/Users/derwent/.node-gyp/11.5.0',
gyp infoinfo spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
spawn argsgyp '/Users/derwent/.node-gyp/11.5.0/include/node/common.gypi',
info spawn argsgyp '-Dnode_lib_file=/Users/derwent/.node-gyp/11.5.0/<(target_arch)/node.lib',
gyp infoinfo spawn args '-Dmodule_root_dir=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv',
gypspawn args info '-Dlibrary=shared_library',
spawn argsgyp '-Dnode_engine=v8',
gyp infoinfo spawn args '--depth=.',
gypspawn args info '-Dvisibility=default',
spawn argsgyp '--no-parallel',
gyp infoinfo spawn args '--generator-output',
spawn argsgyp '-Dnode_root_dir=/Users/derwent/.node-gyp/11.5.0',
info gypspawn args 'build',
infogyp spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gypinfo infospawn args '-Goutput_dir=.' ]
spawn args '-Dnode_lib_file=/Users/derwent/.node-gyp/11.5.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info ok
gyp info ok
gypgyp info infoit worked if it ends with ok
it worked if it ends with ok
gyp gypinfo usinginfo node-gyp@3.8.0
using node-gyp@3.8.0
gyp infogyp usinginfo node@11.5.0 | darwin | x64
using node@11.5.0 | darwin | x64
gypgyp info infospawn make
spawn make
gypgyp infoinfo spawn argsspawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
[ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/opencv/src/init.o
CXX(target) Release/obj.target/opencv/src/init.o
rm: ./Release/.deps/Release/obj.target/opencv/src/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/opencv/src/init.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/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node/11.5.0/bin/node" "/usr/local/Cellar/node/11.5.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64/opencv.node" "--module_name=opencv" "--module_path=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64"
gyp ERR! cwd /Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv
gyp ERR! node -v v11.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
CXX(target) Release/obj.target/opencv/src/Matrix.o
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp build --fallback-to-build --module=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64/opencv.node --module_name=opencv --module_path=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189: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 Darwin 18.2.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/11.5.0/bin/node" "/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv
node-pre-gyp ERR! node -v v11.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp build --fallback-to-build --module=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64/opencv.node --module_name=opencv --module_path=/Users/derwent/Documents/GitHub/JS-Telecortex-2/node_modules/opencv/build/opencv/v6.0.0/Release/node-v67-darwin-x64' (1)
../src/Matrix.cc:130:31: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
mat = new Matrix(info[0]->IntegerValue(), info[1]->IntegerValue());
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:130:56: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
mat = new Matrix(info[0]->IntegerValue(), info[1]->IntegerValue());
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:133:31: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
mat = new Matrix(info[0]->IntegerValue(), info[1]->IntegerValue(),
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:133:56: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
mat = new Matrix(info[0]->IntegerValue(), info[1]->IntegerValue(),
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:134:18: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
info[2]->IntegerValue());
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:137:31: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
mat = new Matrix(info[0]->IntegerValue(), info[1]->IntegerValue(),
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:137:56: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
mat = new Matrix(info[0]->IntegerValue(), info[1]->IntegerValue(),
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:138:18: warning: 'IntegerValue' is deprecated: Use maybe version [-Wdeprecated-declarations]
info[2]->IntegerValue(), info[3]->ToObject());
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2570:3: note: 'IntegerValue' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", int64_t IntegerValue() const);
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8config.h:326:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
../src/Matrix.cc:138:43: warning: 'ToObject' is deprecated: Use maybe version [-Wdeprecated-declarations]
info[2]->IntegerValue(), info[3]->ToObject());
^
/Users/derwent/.node-gyp/11.5.0/include/node/v8.h:2549:10: note: 'ToObject' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local
Hi there, I tried following the instructions and couldn't get it to build with
yarn add opencv
There is a very long build output with lots of deprecation warnings, but some errors that stood out were:Full output: