Skip to content

node-gyp rebuild problem #274

@dreamOf

Description

@dreamOf

当我执行 node-gyp rebuild命令的时候,出现如下异常,请问大佬们有解决方案吗?
E:\test\node-ffi-napi>node-gyp rebuild --verbose
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'D:\tool\nvm_link\node.exe',
gyp verb cli 'D:\tool\nvm_link\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose'
gyp verb cli ]
gyp info using node-gyp@10.1.0
gyp info using node@20.11.1 | win32 | x64
gyp verb clean removing "build" directory
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if the py launcher can be used to find Python 3
gyp verb find Python - executing "py.exe" to get Python 3 executable path
gyp verb find Python - executable path is "D:\install\py12\python.exe"
gyp verb find Python - executing "D:\install\py12\python.exe" to get version
gyp verb find Python - version is "3.12.3"
gyp info find Python using Python version 3.12.3 found at "D:\install\py12\python.exe"
gyp verb get node dir no --target version specified, falling back to host node version: 20.11.1

gyp verb install input version string "20.11.1"
gyp verb install installing version: 20.11.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 11
gyp verb needs "installVersion" 11
gyp verb install version is good
gyp verb on Windows; need to check node.lib
gyp verb get node dir target node version installed: 20.11.1
gyp verb build dir attempting to create "build" dir: E:\test\node-ffi-napi\build
gyp verb build dir "build" dir needed to be created? Yes
gyp verb find VS msvs_version not set from command line or npm config
gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp verb find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
gyp verb find VS
gyp verb find VS Failure details: undefined
gyp verb find VS checking VS2022 (17.10.34928.147) found at:
gyp verb find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp verb find VS - found "Visual Studio C++ core features"
gyp verb find VS - found VC++ toolset: v143
gyp verb find VS - found Windows SDK: 10.0.22621.0
gyp info find VS using VS2022 (17.10.34928.147) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: E:\test\node-ffi-napi\build\config.gypi
gyp verb config.gypi checking for gypi file: E:\test\node-ffi-napi\config.gypi
gyp verb common.gypi checking for gypi file: E:\test\node-ffi-napi\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn D:\install\py12\python.exe
gyp info spawn args [
gyp info spawn args 'D:\install\nvm\v20.11.1\node_modules\node-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 '-I',
gyp info spawn args 'E:\test\node-ffi-napi\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\install\nvm\v20.11.1\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\include\node\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1',
gyp info spawn args '-Dnode_gyp_dir=D:\install\nvm\v20.11.1\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\PC\\AppData\\Local\\node-gyp\\Cache\\20.11.1\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=E:\test\node-ffi-napi',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'E:\test\node-ffi-napi\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1
gyp verb python D:\install\py12\python.exe
gyp verb found first Solution file build\binding.sln
gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build\binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
生成启动时间为 2024/6/1 19:38:02。

节点 1 上的项目“E:\test\node-ffi-napi\build\binding.sln”(默认目标)。
ValidateSolutionConfiguration:
正在生成解决方案配置“Release|x64”。
项目“E:\test\node-ffi-napi\build\binding.sln”(1)正在节点 1 上生成“E:\test\node-ffi-napi\build\deps\libffi\ffi.vcxproj”(2) (默认目标)

PrepareForBuild:
正在创建目录“Release\obj\ffi\”。
已启用结构化输出。编译器诊断的格式设置将反映错误层次结构。有关详细信息,请参阅 https://aka.ms/cpp/structured-output。
正在创建目录“E:\test\node-ffi-napi\build\Release\”。
正在创建目录“Release\obj\ffi\ffi.tlog\”。
InitializeBuildStatus:
正在创建“Release\obj\ffi\ffi.tlog\unsuccessfulbuild”,因为已指定“AlwaysCreate”。
正在对“Release\obj\ffi\ffi.tlog\unsuccessfulbuild”执行 Touch 任务。
_preprocess_asm:
Preprocessing assembly file ......\deps\libffi\src\x86\win64_intel.preasm
cmd.exe /Q /D /C "C:\Users\PC\AppData\Local\Temp\MSBuildTemp\tmp799e8a67c3d641ad9f595e625eb39645.cmd"
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"
'"call"' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
E:\test\node-ffi-napi\build\deps\libffi\ffi.targets(34,5): error MSB3721: 命令“call "call" "../../../deps/libffi/preproce
ss_asm.cmd" "../../../deps/libffi/include" "../../../deps/libffi/config/win/x64" "......\deps\libffi\src\x86\win64_in
tel.preasm" "Release\obj\ffi\win64_intel.asm"”已退出,返回代码为 1。 [E:\test\node-ffi-napi\build\deps\libffi\ffi.vcxproj]
已完成生成项目“E:\test\node-ffi-napi\build\deps\libffi\ffi.vcxproj”(默认目标)的操作 - 失败。

项目“E:\test\node-ffi-napi\build\binding.sln”(1)正在节点 1 上生成“E:\test\node-ffi-napi\build\ffi_bindings.vcxproj.metaproj”(3)
(默认目标)。
项目“E:\test\node-ffi-napi\build\ffi_bindings.vcxproj.metaproj”(3)正在节点 1 上生成“E:\test\node-ffi-napi\build\node_modules\nod
e-addon-api\nothing.vcxproj”(4) (默认目标)。
PrepareForBuild:
正在创建目录“Release\obj\nothing\”。
已启用结构化输出。编译器诊断的格式设置将反映错误层次结构。有关详细信息,请参阅 https://aka.ms/cpp/structured-output。
正在创建目录“Release\obj\nothing\nothing.tlog\”。
InitializeBuildStatus:
正在创建“Release\obj\nothing\nothing.tlog\unsuccessfulbuild”,因为已指定“AlwaysCreate”。
正在对“Release\obj\nothing\nothing.tlog\unsuccessfulbuild”执行 Touch 任务。
MakeDirsForCl:
正在创建目录“E:\test\node-ffi-napi\build\node_modules\node-addon-api\Release\obj\nothing\node_modules\node-addon-api” 。
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\CL.exe /c /I
"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\include\node" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\s
rc" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\openssl\config" /I"C:\Users\PC\AppData\Local\node-gyp\Ca
che\20.11.1\deps\openssl\openssl\include" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\uv\include" /I"C:
Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\zlib" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\v8
include" /Z7 /nologo /W3 /WX- /diagnostics:column /MP /Ox /Ob2 /Oi /Ot /Oy /GL /D NODE_GYP_MODULE_NAME=nothing /D USI
NG_UV_SHARED=1 /D USING_V8_SHARED=1 /D V8_DEPRECATION_WARNINGS=1 /D _GLIBCXX_USE_CXX11_ABI=1 /D WIN32 /D CRT_SECURE
NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0 /D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D "HOST_BI
NARY="node.exe"" /GF /Gm- /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Fo"Release\obj\nothing
\node_modules\node-addon-api\nothing.obj" /Fd"E:\test\node-ffi-napi\build\Release\nothing.pdb" /external:W3 /Gd /TC /
wd4351 /wd4355 /wd4800 /wd4251 /wd4275 /wd4244 /wd4267 /FC /errorReport:queue /Zc:__cplusplus -std:c++17 "......\no
de_modules\node-addon-api\nothing.c"
nothing.c
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\CL.exe /c /I
"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\include\node" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\s
rc" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\openssl\config" /I"C:\Users\PC\AppData\Local\node-gyp\Ca
che\20.11.1\deps\openssl\openssl\include" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\uv\include" /I"C:
Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\zlib" /I"C:\Users\PC\AppData\Local\node-gyp\Cache\20.11.1\deps\v8
include" /Z7 /nologo /W3 /WX- /diagnostics:column /MP /Ox /Ob2 /Oi /Ot /Oy /GL /D NODE_GYP_MODULE_NAME=nothing /D USI
NG_UV_SHARED=1 /D USING_V8_SHARED=1 /D V8_DEPRECATION_WARNINGS=1 /D _GLIBCXX_USE_CXX11_ABI=1 /D WIN32 /D CRT_SECURE
NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0 /D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D "HOST_BI
NARY="node.exe"" /GF /Gm- /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Fo"Release\obj\nothing
" /Fd"E:\test\node-ffi-napi\build\Release\nothing.pdb" /external:W3 /Gd /TP /wd4351 /wd4355 /wd4800 /wd4251 /wd4275
/wd4244 /wd4267 /FC /errorReport:queue /Zc:__cplusplus -std:c++17 "D:\install\nvm\v20.11.1\node_modules\node-gyp\src
win_delay_load_hook.cc"
win_delay_load_hook.cc
Lib:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\Lib.exe /OUT
:"E:\test\node-ffi-napi\build\Release\nothing.lib" /NOLOGO /MACHINE:X64 /LTCG:INCREMENTAL Release\obj\nothing\win_del
ay_load_hook.obj
"Release\obj\nothing\node_modules\node-addon-api\nothing.obj"
nothing.vcxproj -> E:\test\node-ffi-napi\build\Release\nothing.lib
FinalizeBuildStatus:
正在删除文件“Release\obj\nothing\nothing.tlog\unsuccessfulbuild”。
正在对“Release\obj\nothing\nothing.tlog\nothing.lastbuildstate”执行 Touch 任务。
已完成生成项目“E:\test\node-ffi-napi\build\node_modules\node-addon-api\nothing.vcxproj”(默认目标)的操作。

已完成生成项目“E:\test\node-ffi-napi\build\ffi_bindings.vcxproj.metaproj”(默认目标)的操作 - 失败。

已完成生成项目“E:\test\node-ffi-napi\build\binding.sln”(默认目标)的操作 - 失败。

生成失败。

“E:\test\node-ffi-napi\build\binding.sln”(默认目标) (1) ->
“E:\test\node-ffi-napi\build\deps\libffi\ffi.vcxproj”(默认目标) (2) ->
(preprocess_asm 目标) ->
E:\test\node-ffi-napi\build\deps\libffi\ffi.targets(34,5): error MSB3721: 命令“call "call" "../../../deps/libffi/prepro
cess_asm.cmd" "../../../deps/libffi/include" "../../../deps/libffi/config/win/x64" "......\deps\libffi\src\x86\win64

intel.preasm" "Release\obj\ffi\win64_intel.asm"”已退出,返回代码为 1。 [E:\test\node-ffi-napi\build\deps\libffi\ffi.vcxproj]

0 个警告
1 个错误

已用时间 00:00:01.00
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess. (D:\install\nvm\v20.11.1\node_modules\node-gyp\lib\build.js:209:23)
gyp ERR! stack at ChildProcess.emit (node:events:518:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "D:\tool\nvm_link\node.exe" "D:\tool\nvm_link\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose"
gyp ERR! cwd E:\test\node-ffi-napi
gyp ERR! node -v v20.11.1
gyp ERR! node-gyp -v v10.1.0
gyp ERR! not ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions