Error when trying to install node-ffi-napi

See original GitHub issue

To make things clear, I have windows-build-tools installed and I set the npm config to python 2.7 folder. (64 bits node and python).

C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app>npm install ffi-napi

> ref-napi@1.4.0 install C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ref-napi
> node-gyp rebuild


C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ref-napi>if not defined npm_config_node_gyp (node "C:\Users\Practicas02\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Practicas02\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Los proyectos de esta solución se van a compilar de uno en uno. Para habilitar la compilación en paralelo, agregue el modificador "/m".
  win_delay_load_hook.cc
  Generando c¾digo
  All 1 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Generaci¾n de c¾digo finalizada
  nothing.vcxproj -> C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ref-napi\build\Release\\nothing.node
  binding.cc
  win_delay_load_hook.cc
     Creando biblioteca C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ref-napi\build\Release\binding.lib y objeto C:\Users\Practicas02\Documents\Proyectos\Navegad
  or Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ref-napi\build\Release\binding.exp
  Generando c¾digo
  All 242 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
  Generaci¾n de c¾digo finalizada
  binding.vcxproj -> C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ref-napi\build\Release\\binding.node

> ffi-napi@2.4.3 install C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ffi-napi
> node-gyp rebuild


C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ffi-napi>if not defined npm_config_node_gyp (node "C:\Users\Practicas02\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Practicas02\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Los proyectos de esta solución se van a compilar de uno en uno. Para habilitar la compilación en paralelo, agregue el modificador "/m".
  Building assembly file ..\..\..\deps\libffi\src\x86\win64.asm
   Assembling: ..\..\..\deps\libffi\src\x86\win64.asm
  prep_cif.c
  types.c
  raw_api.c
  java_raw_api.c
  closures.c
  ffi.c
  win_delay_load_hook.cc
  ffi.vcxproj -> C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ffi-napi\build\Release\\libffi.lib
  nothing.vcxproj -> C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ffi-napi\build\Release\\nothing.lib
  ffi.cc
  callback_info.cc
  threaded_callback_invokation.cc
  win32-dlfcn.cc
  win_delay_load_hook.cc
c:\users\practicas02\documents\proyectos\navegador electron adif\aplicacion electron\electron_adif\app\node_modules\ffi-napi\src\ffi.cc(3): fatal error C1083: No se puede abrir el archivo incluir: 'get-uv-event-loop-napi.h': No such
 file or directory [C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ffi-napi\build\ffi_bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Practicas02\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Practicas02\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Practicas02\Documents\Proyectos\Navegador Electron ADIF\Aplicacion Electron\electron_adif\app\node_modules\ffi-napi
gyp ERR! node -v v10.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint-plugin-jsx-a11y@^5.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@1.9.0 requires a peer of eslint@>=1.6.0 <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffi-napi@2.4.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi-napi@2.4.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Practicas02\AppData\Roaming\npm-cache\_logs\2018-10-08T08_18_49_857Z-debug.log

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:10

github_iconTop GitHub Comments

13reactions
DanielAskTiacommented, Sep 10, 2019

The issue is most likely spaces in the directory name. Install node-ffi-napi to a directory w/o spaces and it should succeed.

5reactions
CountDucoocommented, Nov 14, 2018

solved by manually copy the h.file you need to C:\Users<yoursuer>.node-gyp<version>\include\node

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does npm install ffi return error. Using node version 12
I am new to nodejs. I am trying to call c++ API in a dll from node-js. So far I found that ffi...
Read more >
node-ffi-napi
node -ffi-napi is a Node.js addon for loading and calling dynamic libraries using pure JavaScript. It can be used to create bindings to ......
Read more >
Developers - Error when trying to install node-ffi-napi -
Error when trying to install node -ffi-napi.
Read more >
ffi-napi-issue-nodejs-v14
Using Node.js v14.9.0 · Requiring ffi-napi in one package, then in another package crashes node with a core dump. The crash seems to...
Read more >
Solving common issues with node-gyp
js installed, you probably already have node-gyp installed but not exposed globally. If you only need to compile add-ons during the project ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found