Axosoft / nsfw

A super fast and scaleable file watcher that provides a consistent interface on Linux, OSX and Windows
MIT License
902 stars 114 forks source link

Node 22 C++20 compilation warning #181

Closed rmmoreira84 closed 1 hour ago

rmmoreira84 commented 4 days ago

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') """

julianmesa-gitkraken commented 4 days ago

Feel free to create a PR

rmmoreira84 commented 1 hour ago

Solved on PR #183