#Unable to install ffi-napi

3 messages · Page 1 of 1 (latest)

livid fern
#

Hey,

I've been looking for some resources but couldn't find anything. So here I am!

I'm unable to npm i ffi-napi. It crash when I'm doing it in my electron projet. Outside of my project, i'm not having any issue.
I've installed electron-rebuild and perform a rebuild but it's not helping.

Errors:

npm ERR! code 1
npm ERR! path C:\Users\me\Documents\Programming\lab\app-electron\node_modules\ffi-napi
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build
npm ERR! The projects are generated individually in this solution. To enable parallel generation, add the "-m" switch.
npm ERR!   nothing.c
npm ERR!   win_delay_load_hook.cc
npm ERR!   nothing.vcxproj -> C:\Users\me\Documents\Programming\lab\app-electron\node_modules\ffi-napi\build\Release\\nothing.lib
npm ERR!   Preprocessing assembly file ..\..\..\deps\libffi\src\x86\win64_intel.preasm
npm ERR! '"call"' is not recognized as an internal or external command,
npm ERR! an executable program, or a batch file.
npm ERR! C:\Users\me\Documents\Programming\lab\app-electron\node_modules\ffi-napi\build\deps\libffi\ffi.targets(34,5): error MSB3721: The command "call "call" "../../../deps/libffi/preprocess_asm.cmd" "../../../deps/libffi/include" "../../../deps/libffi/config/win/x64" "..\..\..\deps\libffi\src\x86\win64_intel.preasm" "Release\obj\ffi\win64_intel.asm"" has exited with code 1. [C:\Users\me\Documents\Programming\lab\app-electron\node_modules\ffi-napi\build\deps\libffi\ffi.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@20.11.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "C:\Users\me\AppData\Local\Programs\Python\Python310\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.32428.217) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"

Versions:

  • Node v20.11
  • Electron v29.1.5

Thanks for the help!

#

To explain a bit more the need, I'd like to get the width and height of a window running outside of my app. Looks like Electron doesn't offer built-in functions for that. So i'm trying to perform this using the user32 lib through ffi-napi.

formal notch