Currently installing nsfw@2.2.4 on node 22.2.0 we have an error when the node-gyp executes the rebuild command.
After researching and analyzing the issue I saw that the problem was that since node 22.0.0 C++20 is used to compile.
And with this version of C++20 the warning C4596 is treated as an error and we can't install nsfw.
The solution that I have is:
Adding on the binding.gyp on the item DisableSpecificWarnings the 4596, since it's not a true error and shouldn't be treated as so.
Hello there,
Currently installing nsfw@2.2.4 on node 22.2.0 we have an error when the node-gyp executes the rebuild command. After researching and analyzing the issue I saw that the problem was that since node 22.0.0 C++20 is used to compile. And with this version of C++20 the warning C4596 is treated as an error and we can't install nsfw.
The solution that I have is:
Steps to reproduce the issue:
When you run this command you will have the following errors: """ error code 1 npm error path C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm error NSFW.cpp npm error C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw\includes\win32\Watcher.h(40,29): error C4596: 'isExcluded': illegal qualified name in member declaration [C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw\build\nsfw.vcxproj] npm error (compiling source file '../src/NSFW.cpp') npm error npm error C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw\includes\win32\Watcher.h(42,51): error C4596: 'getWatchedPathFromHandle': illegal qualified name in member declaration [C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw\build\nsfw.vcxproj] npm error (compiling source file '../src/NSFW.cpp') npm error npm error C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw\includes\win32\Watcher.h(43,35): error C4596: 'checkWatchedPath': illegal qualified name in member declaration [C:\cmf\Product\development\IoMT\dependencies\IoTBuildAddons\Windows\node_modules\nsfw\build\nsfw.vcxproj] npm error (compiling source file '../src/NSFW.cpp') """