node-gyp
node-gyp copied to clipboard
make: *** No rule to make target `Release/obj.target/binding/src/binding.o', needed by `Release/binding.node'. Stop.
$ node-gyp rebuild
make: *** No rule to make target Release/obj.target/binding/src/binding.o', needed by Release/binding.node'. Stop.
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/chetankhandla/.nvm/versions/node/v14.13.1/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/chetankhandla/.nvm/versions/node/v14.13.1/bin/node" "/Users/chetankhandla/.nvm/versions/node/v14.13.1/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/chetankhandla/projects/sagar/everything-alternative-website
gyp ERR! node -v v14.13.1
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
We're going to need a fair bit more information than this in order to offer any help. Are you attempting to install and compile an addon from npm, or are you writing your own? Can you share any more information about it, maybe your binding.gyp? Do you have the right tools installed (https://github.com/nodejs/node-gyp#on-macos)?
Same Issue.
Macbook Pro Catalina 10.15.7
OpenCV 4.5 (Brew)
I have binding.gyp file,
I think I found a strange behavior, when I change the xcode version value manually from the auto generated build directory.
I do this:
node-gyp clean
node-gyp configure
Then I get a build directory structure with files only.
If I do
node-gyp build
Then I get the Error. But with the same directory structure:

But if I change node-gyp version in build/config.gipy:
"variables": {
// ...
"xcode_version": "12.0",
// to
"xcode_version": "12.3",
// because I have xcode version 12.3
}
I still get the same Error, but with 2 Differences:
1- New log appear in console on top of error : "ACTION Regenerating Makefile"
2- a directory build/Release is created with a file build/Release/.deps/Makefile.d

Could it be the XCode of Catalina having problem sending the right information when Node-Gyp launches configuration?
I had XCode at 2 places, 1 under the Applications/XCode.app/... and 1 in /Library/Developer/CommandLineTools/. I didn't reached that far with the first one, and while looking for solution, I switched to the 2nd with:
sudo xcode-select --switch /Library/Developer/CommandLineTools/
I gonna try to switch back to XCode.app again to see. That is really strange.
Every macOS update breaks Command Line Tools for XCode so after every macOS update, do
xcode-select --install
Thanks @cclauss . It was my mistake. I used the default binding.gyp values innocently, thinking it has to do with node-gyp internal config under relative path. So instead keyword biding, as I was compiling node_modules/opencv4nodejs, then I had to ajust it like:
// binding.gyp
{
"targets": [
{
"target_name": "opencv4nodejs",
"sources": [ "node_modules/opencv4nodejs/cc/opencv4nodejs.cc" ]
}
]
}
So it's a config that is bind to the module you want to compile. I didn't took enough time to read as my brain is tired after all that back and forth since 2 days trying to install this with tons of errors, starting from updating xcode itself.
I think a change in the README to my-module-name instead of binding would be nicer for exhausted brains. Lol.
{
"targets": [
{
"target_name": "my-module-name",
"sources": [ "my-module-path/my-module.cc" ]
}
]
}
And now I'm getting 1 last single error:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/opencv4nodejs/node_modules/opencv4nodejs/cc/opencv4nodejs.o
In file included from ../node_modules/opencv4nodejs/cc/opencv4nodejs.cc:2:
In file included from ../node_modules/opencv4nodejs/cc/ExternalMemTracking.h:1:
../node_modules/opencv4nodejs/cc/macros.h:1:10: fatal error: 'NativeNodeUtils.h' file not found
#include "NativeNodeUtils.h"
^~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/opencv4nodejs/node_modules/opencv4nodejs/cc/opencv4nodejs.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:376:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node/15.4.0/bin/node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /Users/Keitel/repos/learning/technology
gyp ERR! node -v v15.4.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
https://www.npmjs.com/package/native-node-utils
Never thought that the system parsing binding.gyp was so powerful and complex. Thanks, but I'm using https://www.npmjs.com/package/opencv4nodejs which already uses native-node-utils internally. The great thing is node_modules/opencv4nodejs already get its own binding.gyp, so I should build it directly inside the module directory.
From now on, I think I should manage the rest on my own.
node_modules/opencv4nodejs/binding.gyp:
{
"targets": [{
"target_name": "opencv4nodejs",
"defines": [
"<!@(node ./install/parseEnv.js OPENCV4NODEJS_DEFINES)",
],
"include_dirs" : [
"<!@(node ./install/parseEnv.js OPENCV4NODEJS_INCLUDES)",
"cc",
"cc/core",
"<!(node -e \"require('nan')\")",
"<!(node -e \"require('native-node-utils')\")"
],
"libraries": [
"<!@(node ./install/parseEnv.js OPENCV4NODEJS_LIBRARIES)",
],
"sources": [
"cc/opencv4nodejs.cc",
"cc/CustomMatAllocator.cc",
"cc/ExternalMemTracking.cc",
"cc/core/core.cc",
"cc/core/coreConstants.cc",
"cc/core/HistAxes.cc",
"cc/core/Mat.cc",
"cc/core/Point.cc",
"cc/core/Vec.cc",
"cc/core/Size.cc",
"cc/core/Rect.cc",
"cc/core/RotatedRect.cc",
"cc/core/TermCriteria.cc",
"cc/imgproc/imgproc.cc",
"cc/imgproc/imgprocConstants.cc",
"cc/imgproc/MatImgproc.cc",
"cc/imgproc/Contour.cc",
"cc/imgproc/Moments.cc",
"cc/calib3d/calib3d.cc",
"cc/calib3d/calib3dConstants.cc",
"cc/calib3d/MatCalib3d.cc",
"cc/io/io.cc",
"cc/io/ioConstants.cc",
"cc/io/VideoCapture.cc",
"cc/io/VideoWriter.cc",
"cc/photo/photo.cc",
"cc/photo/photoConstants.cc",
"cc/photo/MatPhoto.cc",
"cc/video/video.cc",
"cc/video/BackgroundSubtractor.cc",
"cc/video/BackgroundSubtractorMOG2.cc",
"cc/video/BackgroundSubtractorKNN.cc",
"cc/ximgproc/ximgproc.cc",
"cc/ximgproc/MatXimgproc.cc",
"cc/ximgproc/SuperpixelSEEDS.cc",
"cc/ximgproc/SuperpixelSLIC.cc",
"cc/ximgproc/SuperpixelLSC.cc",
"cc/objdetect/objdetect.cc",
"cc/objdetect/CascadeClassifier.cc",
"cc/objdetect/HOGDescriptor.cc",
"cc/objdetect/DetectionROI.cc",
"cc/machinelearning/machinelearning.cc",
"cc/machinelearning/machinelearningConstants.cc",
"cc/machinelearning/ParamGrid.cc",
"cc/machinelearning/StatModel.cc",
"cc/machinelearning/SVM.cc",
"cc/machinelearning/TrainData.cc",
"cc/dnn/dnn.cc",
"cc/dnn/Net.cc",
"cc/face/face.cc",
"cc/face/FaceRecognizer.cc",
"cc/face/EigenFaceRecognizer.cc",
"cc/face/FisherFaceRecognizer.cc",
"cc/face/LBPHFaceRecognizer.cc",
"cc/face/Facemark.cc",
"cc/face/FacemarkAAM.cc",
"cc/face/FacemarkAAMData.cc",
"cc/face/FacemarkAAMParams.cc",
"cc/face/FacemarkLBF.cc",
"cc/face/FacemarkLBFParams.cc",
"cc/text/text.cc",
"cc/text/OCRHMMClassifier.cc",
"cc/text/OCRHMMDecoder.cc",
"cc/tracking/tracking.cc",
"cc/tracking/Tracker.cc",
"cc/tracking/MultiTracker.cc",
"cc/tracking/Trackers/TrackerBoosting.cc",
"cc/tracking/Trackers/TrackerBoostingParams.cc",
"cc/tracking/Trackers/TrackerKCF.cc",
"cc/tracking/Trackers/TrackerKCFParams.cc",
"cc/tracking/Trackers/TrackerMIL.cc",
"cc/tracking/Trackers/TrackerMILParams.cc",
"cc/tracking/Trackers/TrackerMedianFlow.cc",
"cc/tracking/Trackers/TrackerTLD.cc",
"cc/tracking/Trackers/TrackerGOTURN.cc",
"cc/tracking/Trackers/TrackerCSRT.cc",
"cc/tracking/Trackers/TrackerCSRTParams.cc",
"cc/tracking/Trackers/TrackerMOSSE.cc",
"cc/features2d/features2d.cc",
"cc/features2d/KeyPoint.cc",
"cc/features2d/KeyPointMatch.cc",
"cc/features2d/DescriptorMatch.cc",
"cc/features2d/BFMatcher.cc",
"cc/features2d/FeatureDetector.cc",
"cc/features2d/descriptorMatching.cc",
"cc/features2d/descriptorMatchingKnn.cc",
"cc/features2d/detectors/AGASTDetector.cc",
"cc/features2d/detectors/AKAZEDetector.cc",
"cc/features2d/detectors/BRISKDetector.cc",
"cc/features2d/detectors/FASTDetector.cc",
"cc/features2d/detectors/GFTTDetector.cc",
"cc/features2d/detectors/KAZEDetector.cc",
"cc/features2d/detectors/MSERDetector.cc",
"cc/features2d/detectors/ORBDetector.cc",
"cc/features2d/detectors/SimpleBlobDetector.cc",
"cc/features2d/detectors/SimpleBlobDetectorParams.cc",
"cc/xfeatures2d/xfeatures2d.cc",
"cc/xfeatures2d/SIFTDetector.cc",
"cc/xfeatures2d/SURFDetector.cc"
],
"cflags" : [
"-std=c++11"
],
"cflags!" : [
"-fno-exceptions"
],
"cflags_cc!": [
"-fno-rtti",
"-fno-exceptions"
],
"ldflags" : [
"-Wl,-rpath,'$$ORIGIN'"
],
"xcode_settings": {
"OTHER_CFLAGS": [
"-std=c++11",
"-stdlib=libc++"
],
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"MACOSX_DEPLOYMENT_TARGET": "10.9"
},
"conditions": [
[ "OS==\"win\"", {
"cflags": [
"-Wall"
],
"defines": [
"WIN",
"_HAS_EXCEPTIONS=1"
],
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": "2",
"RuntimeLibrary": "2"
},
}
}],
["OS==\"mac\"",
{
"link_settings": {
"libraries": [
"-Wl,-rpath,@loader_path/../../../opencv-build/opencv/build/lib"
],
}
}
]
],
"configurations": {
"Debug": {
"cflags": ["--coverage"],
"ldflags": ["--coverage"]
},
}
}]
}
@ryyant None of the above posts talk about trying to install the deprecated node-sass. https://github.com/nodejs/node-gyp/issues?q=is%3Aissue+label%3A%22Node+Sass+--%3E+Dart+Sass%22
Hello @cclauss I'm facing the same issue with tfjs-node bindings can you help with the bindings.gyp file
https://github.com/tensorflow/tfjs-node is archived.
it isn't archived it has just been shifted to main tfjs repo https://github.com/tensorflow/tfjs