justadudewhohacks / justadudewhohacks/opencv4nodejs

Can't install with Auto Build

Open
#476 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

Hello!
I can't install `opencv4nodejs` with Auto Build once my manually installed OpenCV versions were uninstalled.
Any help is appreciated.

**sys info:**
Ubuntu 16.04
Nodejs: 8.1.4

## Steps
1. All manually installed OpenCV vers were uninstalled.

```
$ pkg-config --cflags opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
```
```
$ pkg-config --modversion opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
```

2. `npm install --save opencv4nodejs`
**log:**
```
> opencv4nodejs@4.13.0 install /home/tania/repo-name/node_modules/opencv4nodejs
> node-gyp rebuild

make: Entering directory '/home/tania/repo-name/node_modules/opencv4nodejs/build'
CXX(target) Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o
In file included from ../cc/CustomMatAllocator.h:8:0,
from ../cc/ExternalMemTracking.h:2,
from ../cc/opencv4nodejs.cc:2:
../cc/core/Size.h:1:28: fatal error: opencv2/core.hpp: No such file or directory
#include
^
compilation terminated.
opencv4nodejs.target.mk:232: recipe for target 'Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o' failed
make: *** [Release/obj.target/opencv4nodejs/cc/opencv4nodejs.o] Error 1
make: Leaving directory '/home/tania/repo-name/node_modules/opencv4nodejs/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/tania/.nvm/versions/node/v8.1.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Linux 4.15.0-42-generic
gyp ERR! command "/home/tania/.nvm/versions/node/v8.1.4/bin/node" "/home/tania/.nvm/versions/node/v8.1.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/tania/repo-name/node_modules/opencv4nodejs
gyp ERR! node -v v8.1.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv4nodejs@4.13.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `npm install --save opencv4nodejs` with the reported Ubuntu and Node.js versions, then inspect the Auto Build and `node-gyp` installation entry points. The failure is the missing `opencv2/core.hpp` header after manual OpenCV versions were removed; done means installation completes with Auto Build and the native module builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, nodejs
Domain
build-system, computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.