Witam, chciałem pobrać nazwę aktywnego okna w nodejs. W npm znalazłem moduł który by mi na to pozwolił, nazywa się "active-window", działa ale dzięki niemu można pobrać nazwę tylko raz, przy drugim pobraniu program się crashuje. Poszukałem dalej i znalazłem "active-win" . Użyłem kodu z dokumentacji:
const activeWin = require('active-win');
(async () => {
console.log(await activeWin());
})();
ale tu też pojawił się problem:
(node:2884) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Could not locate the bindings file. Tried:
→ C:\Users\Lenovo\node_modules\ref-napi\build\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\build\Debug\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\build\Release\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\out\Debug\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\Debug\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\out\Release\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\Release\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\build\default\binding.node
→ C:\Users\Lenovo\node_modules\ref-napi\compiled\8.9.4\win32\x64\binding.node
(node:2884) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.