problems you are having
I'd like to use FFI in Node.js, but when npm install ffi
,
gypErr:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe failed with exit code:1
The error appears with .
Windows built tools are already installed.
environment
Supplementary
gyp ERR! stack Error: `gyp`failed with exit code:1
and errors.
node.js npm
Support for ffi
seems to have ended with Node 11.
ffi-napi
seems to be the replacement for Node 12 and later.https://www.npmjs.com/package/ffi-napi
There was no error using this.
ffi-napi
is the same as ffi
.
Installation method
For Windows,
Install windows build tools on Powershell with administrator privileges.
Then install node-gyp under npm-g install node-gyp
.
Then enter npm install ffi-napi
.
How-to
var ffi=require('ffi-napi');
It is the same as ffi
except for writing .
If you use ref
, ref-napi
is supported instead, so install it separately.
Reference site: https://usagi.hatenablog.jp/entry/2020/03/18/191928
© 2024 OneMinuteCode. All rights reserved.