错误:无法运行:pkg-config“ opencv> = 2.3.1” --cflags-是否已安装OpenCV?

时间:2019-07-29 09:37:02

标签: node.js opencv npm ubuntu-18.04 node-opencv

我尝试安装opencv npm软件包,但遇到以下错误,即在安装即时通讯时错过的任何内容或需要检查任何内容。我已经安装了python 3.6.8

  

npm我opencv

仅获得以下错误

  

无法运行:pkg-config“ opencv> = 2.3.1” --cflags-是否已安装OpenCV?

gopalakrishnan@GopalakrishanR-Ubuntu:~/Documents/XeniaWorkspace/xenia_api$ npm i opencv
npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead:
npm WARN deprecated   npm i nyc
npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives.

> opencv@6.2.0 install /home/gopalakrishnan/Documents/XeniaWorkspace/xenia_api/node_modules/opencv
> node-gyp rebuild

/home/gopalakrishnan/Documents/XeniaWorkspace/xenia_api/node_modules/opencv/utils/find-opencv.js:28
              throw new Error("ERROR: failed to run: pkg-config" + opencv + " " + flag + " - Is OpenCV installed?");
              ^

Error: ERROR: failed to run: pkg-config "opencv >= 2.3.1" --cflags - Is OpenCV installed?
    at /home/gopalakrishnan/Documents/XeniaWorkspace/xenia_api/node_modules/opencv/utils/find-opencv.js:28:21
    at ChildProcess.exithandler (child_process.js:301:5)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:597:12)
gyp: Call to 'node utils/find-opencv.js --cflags' returned exit status 1 while in binding.gyp. 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/nodejs/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.15.0-20-generic
gyp ERR! command "/usr/local/lib/nodejs/node-v10.15.3-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v10.15.3-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/gopalakrishnan/Documents/XeniaWorkspace/xenia_api/node_modules/opencv
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/home/gopalakrishnan/Documents/XeniaWorkspace/xenia_api/package.json'
npm WARN xenia_api No description
npm WARN xenia_api No repository field.
npm WARN xenia_api No README data
npm WARN xenia_api No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! opencv@6.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the opencv@6.2.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/gopalakrishnan/.npm/_logs/2019-07-29T09_20_49_479Z-debug.log

谢谢 Gopal.R

0 个答案:

没有答案