An error occurred while compiling ffi with the nw-gyp command
See original GitHub issueWhen i am using this command,there was an exception:
npm install ffi
cd node_modules/ffi
...\node_modules\ffi>nw-gyp rebuild --target=0.25.3 -arch=ia32 --msvs_version=2015 --release
The error message is shown below:
C:\Users\Administrator\Desktop\myapp\node_modules\ffi>nw-gyp rebuild --target=0.25.3 -arch=ia32 --msvs_version=2015 --release
gyp info it worked if it ends with ok
gyp info using nw-gyp@3.4.0
gyp info using node@8.4.0 | win32 | ia32
gyp info spawn C:\Users\Administrator\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\nw-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2015',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Administrator\\Desktop\\myapp\\node_modules\\ffi\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\nw-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Administrator\\.nw-gyp\\0.25.3\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\Administrator\\.nw-gyp\\0.25.3',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\nw-gyp',
gyp info spawn args '-Dnode_lib_file=nw.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Administrator\\Desktop\\myapp\\node_modules\\ffi',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '-Dv13=1',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\Administrator\\Desktop\\myapp\\node_modules\\ffi\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=Win32' ]
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
Building assembly file ..\..\..\deps\libffi\src\x86\win32.asm
Assembling: ..\..\..\deps\libffi\src\x86\win32.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\Administrator\Desktop\myapp\node_modules\ffi\build\Release\\libffi.lib
ffi.cc
callback_info.cc
threaded_callback_invokation.cc
win32-dlfcn.cc
win_delay_load_hook.cc
c:\users\Administrator\desktop\myapp\node_modules\_nan@2.7.0@nan\nan_maybe_43_inl.h(112): warning C4996: 'v8::Object::ForceSet': 被声明为已否决 (编译源文件 ..\src\ffi.cc) [C:\Users\Administrator\Desktop\myapp\node_module
s\ffi\build
\ffi_bindings.vcxproj]
C:\Users\Administrator\.nw-gyp\0.25.3\deps\v8\include\v8.h(3102): note: 参见“v8::Object::ForceSet”的声明 (编译源文件 ..\src\ffi.cc)
c:\users\Administrator\desktop\myapp\node_modules\_nan@2.7.0@nan\nan_maybe_43_inl.h(112): warning C4996: 'v8::Object::ForceSet': 被声明为已否决 (编译源文件 ..\src\callback_info.cc) [C:\Users\Administrator\Desktop\myapp\n
ode_modules
\ffi\build\ffi_bindings.vcxproj]
C:\Users\Administrator\.nw-gyp\0.25.3\deps\v8\include\v8.h(3102): note: 参见“v8::Object::ForceSet”的声明 (编译源文件 ..\src\callback_info.cc)
c:\users\Administrator\desktop\myapp\node_modules\_nan@2.7.0@nan\nan_maybe_43_inl.h(112): warning C4996: 'v8::Object::ForceSet': 被声明为已否决 (编译源文件 ..\src\threaded_callback_invokation.cc) [C:\Users\Weeta
o\Desktop\d
kq\node_modules\ffi\build\ffi_bindings.vcxproj]
C:\Users\Administrator\.nw-gyp\0.25.3\deps\v8\include\v8.h(3102): note: 参见“v8::Object::ForceSet”的声明 (编译源文件 ..\src\threaded_callback_invokation.cc)
..\src\ffi.cc(111): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(111): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
..\src\ffi.cc(114): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(114): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
..\src\ffi.cc(123): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(123): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
..\src\ffi.cc(124): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(124): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
..\src\ffi.cc(125): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(125): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
..\src\ffi.cc(126): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(126): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
..\src\ffi.cc(132): error C2664: “v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>,v8::Local<v8::Value>,v8::Local<v8::Value>,v8::PropertyAttribute)”: 无法将参数 3 从“v8::PropertyAttribute
”转换为“v8::
Local<v8::Value>” [C:\Users\Administrator\Desktop\myapp\node_modules\ffi\build\ffi_bindings.vcxproj]
..\src\ffi.cc(132): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Administrator\AppData\Roaming\npm\node_modules\nw-gyp\lib\build.js:294:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\nw-gyp\\bin\\nw-gyp.js" "rebuild" "--target=0.25.3" "-arch=ia32" "--msvs_version=201
5" "--release"
gyp ERR! cwd C:\Users\Administrator\Desktop\myapp\node_modules\ffi
gyp ERR! node -v v8.4.0
gyp ERR! nw-gyp -v v3.4.0
gyp ERR! not ok
Using the node-gyp command does not occur with this error:
...\node_modules\ffi>node-gyp rebuild -arch=ia32 --msvs_version=2015
Operating environment: node: v8.4.0(bit 32) nw-gyp: v3.4.0 os: windows 7(bit 64)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
MacOS 11 - Big Sur Beta 3 - Compile Failure · Issue #814 · ffi/ffi
The following compile error results: ... /2.6.0/ffi-1.12.2/gem_make.out An error occurred while installing ffi (1.12.2), and Bundler cannot.
Read more >An error occured while installing ffi (1.1.2), and Bundler cannot ...
I have XCode installed as well as command line tools. ruby-on-rails · gem · ffi · osx-mountain-lion.
Read more >Error: Failed to build gem native extension for ffi on Mac OS X
An error occurred while installing ffi (1.9.10), and Bundler cannot continue. Make sure that `gem install ffi -v '1.9.10'` succeeds before ...
Read more >an error occurred while installing ffi (1.12.2), and bundler ...
Hi there, I'm trying to install a jekyll site on my computer. When I run bundle install, I get the following error: An...
Read more >ffi 1.15.5 - ffi | RubyGems.org | your community gem host
ffi 1.15.5. Ruby FFI library ... Development Dependencies (4):. rake ~> 13.0. rake-compiler ~> 1.0. rake-compiler-dock ~> 1.0. rspec ~> 2.14.1.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because ffi doesn’t support Node 9.x yet, which is included in NW 0.27: https://github.com/node-ffi/node-ffi/pull/439
You could try a previous NW version which contains the similar v8 version with the Node.js version which ffi supports.
This is still an issue. I’m on Windows 10 x64, removed all previous versions of MSVS, then did
npm install -g windows-build-tools
vis admin powershell.