最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Cannot find module '..buildReleaseopencv4nodejs - Stack Overflow

programmeradmin3浏览0评论

I am new to OpenCV and node js, trying to learn OpenCV in node js.

I came across opencv4nodejs which I found best for learning.

I have followed all steps to install OpenCV and setting environment variables for OpenCV and done npm install opencv4nodejs also. able to run Quick start code given but when I try to run example machineLearningOCR.js from examples folder I get error Error: Cannot find module '../build/Release/opencv4nodejs'

I run mand node machineLearningOCR.js from cmd but getting error mentioned above on line const cv = require('../');

How to run examples given in opencv4nodejs?

I am new to OpenCV and node js, trying to learn OpenCV in node js.

I came across opencv4nodejs which I found best for learning.

I have followed all steps to install OpenCV and setting environment variables for OpenCV and done npm install opencv4nodejs also. able to run Quick start code given but when I try to run example machineLearningOCR.js from examples folder I get error Error: Cannot find module '../build/Release/opencv4nodejs'

I run mand node machineLearningOCR.js from cmd but getting error mentioned above on line const cv = require('../');

How to run examples given in opencv4nodejs?

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Dec 21, 2017 at 12:28 R.zeiwaldR.zeiwald 412 silver badges6 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

If you cloned the repository and want to use the examples directly from the examples folder then you have to npm install in the root directory first to build the module.

Optionally you can npm install opencv4nodejs in any project directory, copy the examples into that directory and replace const cv = require('../'); with const cv = require('opencv4nodejs');.

You can also directly submit an issue here: https://github./justadudewhohacks/opencv4nodejs/issues

I had the same problem and I did solve the issue with the following steps.

First all of. I checked the npm version, for this case I remend you updated or pass your software resources at the next version.

NodeJs 14.16.0

NodeJs version: 14.16.0. You can verify the version with this mand if you had another NodeJs version installed

node --version

Npm version: 6.4.11 You need verify if you had this version installed only you will able to validate this if you have NodeJs but if you didn't have node you can install the version I remend you

npm --version

After you set the NodeJs and npm versions you need to verify the following things

  • Have visual studio 2015 or latest with the development for desktop ponent

  • Have cmake program installed

  • Have git bash

  • Have Java or the language you will to work

  • Have the environment variables for the above programs I mentioned

Then you can try again to install open Cv

You need to reopen another or new terminal and then you will execute this mand

npm install --save openc4nodejs

And then

npm install -g openc4nodejs

After than or before don't forget to install appium I remend you 1.19.1 version

You can verify if you have appium with opencv with open Cv doctor you can run appium-doctor and check if the Open cv ponent are present.

For to install appium doctor you can run this mand, npm install -g appium-doctor

I hope this answers will be helpful for you

Autor: Eder Carbonero

发布评论

评论列表(0)

  1. 暂无评论