Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get the following error when installing #416

Closed
NFodrea opened this issue Jun 5, 2016 · 2 comments
Closed

I get the following error when installing #416

NFodrea opened this issue Jun 5, 2016 · 2 comments

Comments

@NFodrea
Copy link

NFodrea commented Jun 5, 2016

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.19.0-25-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Sun Jun  5 03:56:33 2016 from 10.0.2.2
vagrant@homestead:~$ apt-get install libopencv
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
vagrant@homestead:~$ sudo apt-get install libopencv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libopencv
vagrant@homestead:~$ sudo apt-get install opencvlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package opencvlib
vagrant@homestead:~$ sudo apt-get install libopencv-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libopencv-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
vagrant@homestead:~$ npm install
npm WARN enoent ENOENT: no such file or directory, open '/home/vagrant/package.json'
npm WARN vagrant No description
npm WARN vagrant No repository field.
npm WARN vagrant No README data
npm WARN vagrant No license field.
vagrant@homestead:~$ cd /vagrant
vagrant@homestead:/vagrant$ npm install

> opencv@3.2.0 install /vagrant/node_modules/opencv
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://node-opencv.s3.amazonaws.com/opencv/v3.2.0/Release/node-v47-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for opencv@3.2.0 and node@5.10.1 (node-v47 ABI) (falling back to source compile with node-gyp) 
make: Entering directory `/vagrant/node_modules/opencv/build'
  CXX(target) Release/obj.target/opencv/src/init.o
In file included from ../src/OpenCV.h:12:0,
                 from ../src/init.cc:1:
../../nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^
../../nan/nan.h:319:17: error: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../../nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../../nan/nan.h:334:27: error: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../../nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../../nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../../nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:768:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../../nan/nan.h:768:67: note: candidates are:
In file included from ../src/OpenCV.h:8:0,
                 from ../src/init.cc:1:
/home/vagrant/.node-gyp/5.10.1/include/node/node_buffer.h:34:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/vagrant/.node-gyp/5.10.1/include/node/node_buffer.h:34:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/vagrant/.node-gyp/5.10.1/include/node/node_buffer.h:46:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/vagrant/.node-gyp/5.10.1/include/node/node_buffer.h:46:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/OpenCV.h:12:0,
                 from ../src/init.cc:1:
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../../nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/opencv/src/init.o] Error 1
make: Leaving directory `/vagrant/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 3.19.0-25-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/vagrant/node_modules/opencv/build/opencv/v3.2.0/Release/node-v47-linux-x64/opencv.node" "--module_name=opencv" "--module_path=/vagrant/node_modules/opencv/build/opencv/v3.2.0/Release/node-v47-linux-x64"
gyp ERR! cwd /vagrant/node_modules/opencv
gyp ERR! node -v v5.10.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/vagrant/node_modules/opencv/build/opencv/v3.2.0/Release/node-v47-linux-x64/opencv.node --module_name=opencv --module_path=/vagrant/node_modules/opencv/build/opencv/v3.2.0/Release/node-v47-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/vagrant/node_modules/opencv/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
node-pre-gyp ERR! System Linux 3.19.0-25-generic
node-pre-gyp ERR! command "/usr/bin/nodejs" "/vagrant/node_modules/opencv/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /vagrant/node_modules/opencv
node-pre-gyp ERR! node -v v5.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/vagrant/node_modules/opencv/build/opencv/v3.2.0/Release/node-v47-linux-x64/opencv.node --module_name=opencv --module_path=/vagrant/node_modules/opencv/build/opencv/v3.2.0/Release/node-v47-linux-x64' (1)
npm WARN face-detection@1.0.0 No repository field.
npm WARN In opencv@3.2.0 replacing bundled version of node-pre-gyp with node-pre-gyp@0.6.28
npm ERR! Linux 3.19.0-25-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v5.10.1
npm ERR! npm  v3.8.3
npm ERR! code ELIFECYCLE

npm ERR! opencv@3.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the opencv@3.2.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs opencv
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls opencv
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /vagrant/npm-debug.log
@yuanchenl
Copy link

+1

@danschultzer
Copy link
Collaborator

Seen the same error in sharp installation: nodejs/nan#420

The issue comes with NAN < v2.0. Try use the most recent opencv release:
"opencv": "5.0.0".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants