install.js is expecting @u4/opencv-build to be installed, and even though it's listed under dependencies those dependencies haven't necessarily been resolved at the point in time when install.js is run. A solution might be to include a preinstall script like this:
"scripts": {
"preinstall": "npm install @u4/opencv-build",
}
... or more robustly (to avoid an install loop):
"scripts": {
"preinstall": "node -e \"try{require('@u4/opencv-build')}catch(e){require('child_process').execSync('npm install @u4/opencv-build')}\""
}
For my install, installing @u4/opencv-build resolves the gyp error that a lot of other issues are referencing:
gyp: Call to 'node ./bin/install.js OPENCV4NODEJS_DEFINES' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
install.jsis expecting@u4/opencv-buildto be installed, and even though it's listed underdependenciesthose dependencies haven't necessarily been resolved at the point in time wheninstall.jsis run. A solution might be to include apreinstallscript like this:... or more robustly (to avoid an install loop):
For my install, installing
@u4/opencv-buildresolves thegyperror that a lot of other issues are referencing: