节点插件编译错误

Node addon compilation error

本文关键字:错误 编译 插件 节点      更新时间:2023-10-16

我是为节点创建 c++ 插件的新手。
我已经安装了Windows构建工具,运行node-gyp build后我遇到了一个奇怪的问题。

在问这个问题之前,我试图做一些研究,但缝隙没有明确的答案。

我还尝试了重新构建节点和构建工具。

我的问题是这个问题的原因是什么以及如何解决它

node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@9.5.0 | win32 | x64
gyp info spawn C:Program Files (x86)Microsoft Visual Studio2017CommunityMSBuild15.0BinMSBuild.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=x64' ]
Projekty w tym rozwiązaniu są tworzone po kolei. Aby umożliwić tworzenie równoległe, dodaj przełącznik "/m".
C:Usersmaciek.node-gyp9.5.0x64node.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x1E5CBE [C:Usersmaci
ekDesktopmcnbuildmyModule.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:Program Files (x86)Microsoft Visual Studio2017CommunityMSBuild15.0BinMSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:UsersmaciekAppDataRoamingnpmnode_modulesnode-gyplibbuild.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\maciek\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "build"
gyp ERR! cwd C:UsersmaciekDesktopmcn
gyp ERR! node -v v9.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

我遇到了这个问题。已通过以下步骤解决

步骤 1 确保 Phython 已安装并在系统变量中安装了路径

立即试用 npm 安装

如果它现在确实有效,请继续执行第二步

步骤 2 删除 .node-gyp 文件夹并重新安装 node-gyp