此问题与"fatal error: bits/libc-header-start.h: No such file or directory" while compiling HTK非常相似,但它发生在Linux上的Electron包重建期间:
┌──(kali♥kali)-[~/Desktop/.../NodeJs/Terminal] 10:51
└─$ node build.js
Packaging app for platform win32 ia32 using electron v7.3.3
Well, sometimes you are not so lucky: gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@16.16.0 | linux | x64
gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
(node:136591) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/kali/.electron-gyp/7.3.3/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/kali/.electron-gyp/7.3.3',
gyp info spawn args '-Dnode_gyp_dir=/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/kali/.electron-gyp/7.3.3/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp',
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 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp/build'
CXX(target) Release/obj.target/bindings/src/serialport.o
In file included from /usr/include/c++/12/stdlib.h:36,
from ../src/./serialport.h:12,
from ../src/serialport.cpp:1:
/usr/include/c++/12/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
41 | #include <bits/c++config.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [bindings.target.mk:110: Release/obj.target/bindings/src/serialport.o] Error 1
make: Leaving directory '/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:527:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.16.0-kali7-amd64
gyp ERR! command "/usr/local/bin/node" "/home/kali/Desktop/.../NodeJs/Terminal/node_modules/.bin/node-gyp" "rebuild" "--target=7.3.3" "--arch=ia32" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp
gyp ERR! node -v v16.16.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
我已经将我的nodejs降级到v16.16.0,因为它看起来像是对以前的问题的有效解决方案。
npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in ../node-addon-api/node_api.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
目前使用以下部门:(基于现有项目)
"devDependencies": {
"electron": "^1.7.5",
"electron-packager": "^12.2.0",
"electron-rebuild": "^1.8.2",
"electron-winstaller": "^2.7.0"
},
我试过安装gcc-multilib,使用最新版本的deps,并从配置中删除-m32
标志。不幸的是,这些都没有奏效。
1条答案
按热度按时间zysjyyx41#
我确实认为这是一个基于项目到项目的问题,但有一些步骤帮助我解决了这个问题:
如前所述,安装
gcc-multilib
,而且将
serailport
软件包降级到8.0.0(在应用程序中使用),添加项目的软件包描述,稍微编辑electron-rebuild
打包器属性名称(因为应用程序构建在与其内容不同的文件夹中),重新启动所有服务并重新安装节点模块。(注:kali-rolling 2022.2)