在nodejs中安装opencv期间出错?

时间:2018-10-11 03:15:09

标签: node.js opencv npm


> opencv-build@0.0.15 install C:\projects\opencvtry\node_modules\opencv-build
> node ./install.js

info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
info install library dir does not exist: C:\projects\opencvtry\node_modules\opencv-build\opencv\build\lib\Release
info install running install script...
ERR! Error: Command failed: cmake --version
'cmake' is not recognized as an internal or external command,
operable program or batch file.

npm WARN opencvtry@1.0.0 No repository field.

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

4 个答案:

答案 0 :(得分:2)

要解决该问题,请通过以下链接下载Cmake安装程序:

https://cmake.org/download/

如果您是Windows,最好建议下载msi安装程序,并选择它为您设置系统环境变量。

太棒了,应该可以解决该错误。

但是,如果您决定手动设置环境变量,请参阅以下文档 https://stellar-group.github.io/hpx/docs/html/hpx/manual/build_system/cmake_basics.html

答案 1 :(得分:0)

我会说您没有安装cmake或不在您的路径中:

'cmake'不被识别为内部或外部命令

在“ npm install --save opencv4nodejs”之前执行“ cmake”,如果找不到该命令,则将其捕获。

答案 2 :(得分:0)

打开您的终端。

步骤1安装brew //如果您的计算机已安装brew,则跳过此步骤。

  

红宝石-e“ $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” / dev / null

第2步安装cMake

  

酿造cmake

您可以检查cmake是否安装

  

cmake --version

答案 3 :(得分:0)

您需要在操作系统中使用“ cmake”,例如。在Debian / Ubuntu中

Configuration