Closed Misoss closed 2 years ago
just tried on a raspberry pi 400, it takes around 1hour:
cmake version 3.18.4
node version v16.13.2
npm version 8.1.2
Your example actually works for me too (about 3hrs of compilation on RPi2).
I don't understand why it works with pnpm install @u4/opencv4nodejs
and not with npm i opencv4nodejs
?
I tried to integrate this into my project, the compile also works, but I have an error during the execution
pi@raspberrypi: $ node server.js
/home/pi/Dev/test_project/node_modules/opencv4nodejs/lib/cv.js:47
throw err
^
Error: Cannot find module '/home/pi/Dev/test_project/node_modules/opencv4nodejs/build/Release/opencv4nodejs'
Require stack:
- /home/pi/Dev/test_project/node_modules/opencv4nodejs/lib/cv.js
- /home/pi/Dev/test_project/node_modules/opencv4nodejs/lib/opencv4nodejs.js
- /home/pi/Dev/test_project/server.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/pi/Dev/test_project/node_modules/opencv4nodejs/lib/cv.js:40:8)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/pi/Dev/test_project/node_modules/opencv4nodejs/lib/cv.js',
'/home/pi/Dev/test_project/node_modules/opencv4nodejs/lib/opencv4nodejs.js',
'/home/pi/Dev/test_project/server.js'
]
}
I have some RPi2 in stock, but 3 hours... it's too much for me.
I use pnpm because it's faster. and I use @u4/opencv4nodejs because it's my fork.
just replace opencv4nodejs by @u4/opencv4nodejs and it should work.
yes I understand that it is a bit long, lol
after the change i got an error
Error: No build found in /home/pi/Dev/test_project/node_modules/.pnpm/@u4+opencv-build@0.4.3/node_modules/@u4/opencv-build you should launch opencv-build-npm once
I don't know why I had to rebuild a second time, and it took much less time about 30min-45min;
pi@raspberrypi:~/Dev/test_project/node_modules/@u4/opencv4nodejs $ node install.js rebuild
now it's OK
Thanks for your help
same error, i quit it's too hard for me to understand cmake,docker, gyp error,and opencv source code,i just know some js html css language,I just need a workable opencv npm, i try every way to build it by following the guide from internet,noway ,two days trying, i cant get the damn npm pakage, every way brings out ten new error. why opencv official just launch a simply workable npm for basic users,,,,,,,,too hard for those who doesn't know c++
Plateform
RaspberryPI
Error Message