c++ - Node 插件编译错误

标签 c++ node.js compiler-errors node-modules node-nan

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

在问这个问题之前,我曾尝试做一些研究,但它似乎没有明确的答案。

我还尝试过重新安装node-gyp和构建工具。

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

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 Studio\2017\Community\MSBuild\15.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=x64' ]
Projekty w tym rozwiązaniu są tworzone po kolei. Aby umożliwić tworzenie równoległe, dodaj przełącznik "/m".
C:\Users\maciek\.node-gyp\9.5.0\x64\node.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x1E5CBE [C:\Users\maci
ek\Desktop\mcn\build\myModule.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\maciek\AppData\Roaming\npm\node_modules\node-gyp\lib\build.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:\Users\maciek\Desktop\mcn
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

关于c++ - Node 插件编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49161334/

相关文章:

c++ - 本身就是模板的特化

node.js - 森托斯 : Setting global environment variables at startup

python - 您如何处理使用Scrapable FormRequest变灰的多个下拉表单

recursion - 使用递归累积列表时出现类型错误

node.js - 为什么当我从数据库中检索我的小猫时它们不能说话

C编译时cmath错误

c++ - 如何调试 Winsock API 调用?

C++ 从 std::vector<std::tuple<int, float>> 获取 std::vector<int>

C++ 对象 block 分配与单独分配

javascript - 使用 Express 从提交中删除 .gitignore API key 的最佳实践是什么?