Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 节点expat错误的ELF类:ELFCLASS64_C++_Node.js_Elf - Fatal编程技术网

C++ 节点expat错误的ELF类:ELFCLASS64

C++ 节点expat错误的ELF类:ELFCLASS64,c++,node.js,elf,C++,Node.js,Elf,我必须在构建机器上构建我的节点应用程序,然后将该应用程序移到目标机器上,因为我无法按照某些依赖性的要求在目标机器上编译C 我在node expat中遇到了一个编译错误,这导致了上面的ELF类错误。我曾尝试在32位和64位版本的linux上重建我的节点应用程序,但当我将其移植到目标机器(应该是64位机器)时,它似乎解决了这个问题 我在构建时遇到以下错误: node-gyp rebuild make: Entering directory `/root/lumos/runner/node_modu

我必须在构建机器上构建我的节点应用程序,然后将该应用程序移到目标机器上,因为我无法按照某些依赖性的要求在目标机器上编译C

我在node expat中遇到了一个编译错误,这导致了上面的ELF类错误。我曾尝试在32位和64位版本的linux上重建我的节点应用程序,但当我将其移植到目标机器(应该是64位机器)时,它似乎解决了这个问题

我在构建时遇到以下错误:

node-gyp rebuild

make: Entering directory `/root/lumos/runner/node_modules/logbook/node_modules/simple-xmpp/node_modules/node-xmpp/node_modules/node-expat/build'
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmltok.o
../deps/libexpat/lib/xmltok.c:471:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:471:1: warning: (near initialization for ‘latin1_encoding_ns.isName2’)
../deps/libexpat/lib/xmltok.c:484:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:484:1: warning: (near initialization for ‘latin1_encoding.isName2’)
../deps/libexpat/lib/xmltok.c:504:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:504:1: warning: (near initialization for ‘ascii_encoding_ns.isName2’)
../deps/libexpat/lib/xmltok.c:517:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:517:1: warning: (near initialization for ‘ascii_encoding.isName2’)
../deps/libexpat/lib/xmltok.c:730:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:730:1: warning: (near initialization for ‘little2_encoding_ns.isName2’)
../deps/libexpat/lib/xmltok.c:749:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:749:1: warning: (near initialization for ‘little2_encoding.isName2’)
../deps/libexpat/lib/xmltok.c:762:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:762:1: warning: (near initialization for ‘internal_little2_encoding_ns.isName2’)
../deps/libexpat/lib/xmltok.c:775:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:775:1: warning: (near initialization for ‘internal_little2_encoding.isName2’)
../deps/libexpat/lib/xmltok.c:871:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:871:1: warning: (near initialization for ‘big2_encoding_ns.isName2’)
../deps/libexpat/lib/xmltok.c:890:1: warning: missing initializer
../deps/libexpat/lib/xmltok.c:890:1: warning: (near initialization for ‘big2_encoding.isName2’)
  CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlrole.o
  AR(target) Release/obj.target/deps/libexpat/libexpat.a
  COPY Release/libexpat.a
  CXX(target) Release/obj.target/node_expat/node-expat.o
  SOLINK_MODULE(target) Release/obj.target/node_expat.node
  SOLINK_MODULE(target) Release/obj.target/node_expat.node: Finished
  COPY Release/node_expat.node
make: Leaving directory `/root/lumos/runner/node_modules/logbook/node_modules/simple-xmpp/node_modules/node-xmpp/node_modules/node-expat/build'
尽管它在我正在构建的机器上运行良好。当我尝试在我的目标机器上运行它时,我得到以下结果:

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: /root/lumos/runner/node_modules/logbook/node_modules/simple-xmpp/node_modules/node-xmpp/node_modules/node-expat/build/Release/node_expat.node: wrong ELF class: ELFCLASS64
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/root/lumos/runner/node_modules/logbook/node_modules/simple-xmpp/node_modules/node-xmpp/node_modules/node-expat/lib/node-expat.js:4:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
bash-4.1#
module.js:356
模块扩展名[扩展名](此,文件名);
^
错误:/root/lumos/runner/node_modules/logbook/node_modules/simple xmpp/node_modules/node xmpp/node_modules/node expat/build/Release/node_expat.node:错误的ELF类:ELFCLASS64
在Module.load(Module.js:356:32)
在Function.Module.\u加载(Module.js:312:12)
at Module.require(Module.js:364:17)
根据需要(模块js:380:17)
反对。(/root/lumos/runner/node_modules/logbook/node_modules/simple xmpp/node_modules/node xmpp/node_modules/node expat/lib/node expat.js:4:13)
在模块处编译(Module.js:456:26)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)
在Function.Module.\u加载(Module.js:312:12)
at Module.require(Module.js:364:17)
bash-4.1#
ELFCLASS64是否告诉我应用程序正在尝试调用64位libs或32位libs?我可以通过node gyp/npm强制node expat使用正确的libs进行编译吗

ELFCLASS64
是否告诉我应用程序正在尝试调用64位libs或32位libs

它告诉您一个32位进程试图打开一个64位库

从您的描述中不清楚如何调用
节点
,但您在目标计算机上调用的二进制文件是32位二进制文件,无法加载64位共享库

您需要调用64位二进制文件,或者以32位模式构建库