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

Cannot find module ffi-napi on Windows 11 #145

Open
jove0610 opened this issue Aug 8, 2022 · 2 comments
Open

Cannot find module ffi-napi on Windows 11 #145

jove0610 opened this issue Aug 8, 2022 · 2 comments

Comments

@jove0610
Copy link

jove0610 commented Aug 8, 2022

this is what it shows if I run node index.js (codes from the docs)

node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Cannot find module 'ffi-napi'
Require stack:
- C:\Users\admin\Desktop\PROJECTS\test\node_modules\active-win\lib\windows.js
- C:\Users\admin\Desktop\PROJECTS\test\node_modules\active-win\index.js
- C:\Users\admin\Desktop\PROJECTS\test\index.js
←[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1005:19)←[39m
←[90m    at require (node:internal/modules/cjs/helpers:102:18)←[39m
    at Object.<anonymous> (C:\Users\admin\Desktop\PROJECTS\test\node_modules\←[4mactive-win←[24m\lib\windows.js:4:13)
←[90m    at Module._compile (node:internal/modules/cjs/loader:1105:14)←[39m
←[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:981:32)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1005:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\admin\\Desktop\\PROJECTS\\test\\node_modules\\active-win\\lib\\windows.js'←[39m,
    ←[32m'C:\\Users\\admin\\Desktop\\PROJECTS\\test\\node_modules\\active-win\\index.js'←[39m,
    ←[32m'C:\\Users\\admin\\Desktop\\PROJECTS\\test\\index.js'←[39m
  ]
}

this is on my co-worker's PC who uses Windows 11. In my PC (Windows 10) I do not encounter any problem so we assume this is specific to Windows 11. We used the same node version (v16.15.1).

the code I'm running was exactly the one in the docs:

const activeWindow = require('active-win');

(async () => {
	console.log(await activeWindow());
})();
@regloff
Copy link

regloff commented Aug 19, 2022

I had the same issue on Windows 11 using node v16.16.0. Switching from active-win 7.6.1 to 7.7.2 solved the issue for me.

@Srini-B
Copy link

Srini-B commented Nov 19, 2022

Did you get to resolve this

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

3 participants