Running make -j4 test fails with the following output
Building addon /home/madara/projects/node/test/addons-napi/test_instanceof/
gyp: binding.gyp not found (cwd: /home/madara/projects/node/test/addons-napi/test_instanceof) while trying to load binding.gyp
Makefile:288: recipe for target 'test/addons-napi/.buildstamp' failed
make[1]: *** [test/addons-napi/.buildstamp] Error 1
Makefile:196: recipe for target 'test' failed
make: *** [test] Error 2
Fixit @benjamingr
You sometimes need to run test-addons-clean when switching between branches or when some addon tests have been changed since you last ran them :)
I have no such command, is that a make target?
yeah, right, I meant make test-addons-clean ;)
Didn't seem to work, I'm still getting the exact same error after running make test-addons-clean and then make -j4 test again.
@MadaraUchiha When I get stuck like that, I use what I affectionately refer to as "The Sledgehammer Approach":
rm -rf test/addons-napi/ && git checkout test/addons-napi && ./configure && make -j4 test
There's a way to do that first part with rm + git and just using git, but I always forget the syntax. I think @refack informed me of it, but I still do the above instead.
FWIW make test-addons-clean works when you do it before switching branches...doing it after probably does not help because it only helps git clean up the artifacts.
We can make make test use git clean to do it properly, but I am not sure if it's a good idea to assume the existence of git in a command like this?
git clean -xdf but it's strong stuff (as in it will remove __anything__ git doesn't know, including any IDE meta files, any temp files or sketches you might have, and might also try to remove your underwear)
Closing, looks like this has been answered.
Most helpful comment
git clean -xdfbut it's strong stuff (as in it will remove __anything__gitdoesn't know, including any IDE meta files, any temp files or sketches you might have, and might also try to remove your underwear)