Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No directory change recorded #114

Open
MMcKester opened this issue Jul 7, 2020 · 0 comments
Open

No directory change recorded #114

MMcKester opened this issue Jul 7, 2020 · 0 comments

Comments

@MMcKester
Copy link

MMcKester commented Jul 7, 2020

Hi everyone,

can anyone help me? I am on Windows 10 (v1909) and installed nsfw in my electron program and can't make it work.
I installed it with the following:

npm install nsfw --save

> [email protected] install C:\Users\daniel\Desktop\my-foo-example\node_modules\nsfw
> node-gyp rebuild

C:\Users\daniel\Desktop\my-foo-example\node_modules\nsfw>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
  NSFW.cpp
  Queue.cpp
  NativeInterface.cpp
  Controller.cpp
  Watcher.cpp
  win_delay_load_hook.cc
     Creating library C:\Users\daniel\Desktop\my-foo-example\node_modules\nsfw\build\Release\nsfw.lib a
  nd object C:\Users\daniel\Desktop\my-foo-example\node_modules\nsfw\build\Release\nsfw.exp
  nsfw.vcxproj -> C:\Users\daniel\Desktop\my-foo-example\node_modules\nsfw\build\Release\\nsfw.node
+ [email protected]

I call nsfw the following way. I expected "start watching" to be printed, but nothing happens. Am I missing something?


var watcher2;

app.whenReady().then(() => {
  createWindow();

  nsfw(
    "C:\\Users\\daniel\\Desktop\\foo",
    function (events) {
      console.log(events);
    },
    {
      debounceMS: 250,
      errorCallback(errors) {
        console.log(errors);
      },
    }
  )
    .then(function (watcher) {
      watcher2 = watcher;
      console.log("start");
      return watcher.start();
    })
    .then(function () {
      console.log("start watching");
      // we are now watching dir for events!
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant