1.打包的过程中出现缺少quicIO.node的时候,其实可以进入source/agent/addons/quicIO这个目录。然后
调用node-gyp configure 会在当前目录中创建Build目录并生成相关的项目文件,最后会报一个 gyp info ok。然后继续执行 node-gyp build编译,在linux下通过make,windows下通过vcbuild,编译完成后,.node文件就会出现在
build/Release 目录下
主要就是在source/agent/addons/quicIO目录执行 node-gyp configure,node-gyp build这两个命令就可以生成quicIO.node了。
/root/owt-server-4.3/source/agent/addons/avstreamLib/build/Release/avstream.node -> /root/owt-server-4.3/dist/streaming_agent/avstreamLib/build/Release /root/owt-server-4.3/source/agent/addons/internalIO/build/Release/internalIO.node -> /root/owt-server-4.3/dist/streaming_agent/internalIO/build/Release /root/owt-server-4.3/source/agent/addons/logger/build/Release/logger.node -> /root/owt-server-4.3/dist/streaming_agent/logger/build/Release /root/owt-server-4.3/source/agent/addons/quicIO/build/Release/quicIO.node -> /root/owt-server-4.3/dist/streaming_agent/quicIO/build/Release CommandFailed: npm install --unsafe-perm npm WARN deprecated bson@1.0.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details Killed ERROR: Command failed: npm install --unsafe-perm npm WARN deprecated bson@1.0.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details Killed added 115 packages from 90 contributors and audited 115 packages in 123.418s found 1 low severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details
可以通过下面几个命令查看依赖库缺失了那些,然后将缺少的依赖库加入环境变量就好了。
ldd /root/owt-server-4.3/dist/sip_agent/sipIn/build/Release/sipIn.node
ldd /root/owt-server-4.3/dist/sip_agent/internalIO/build/Release/internalIO.node
ldd /root/owt-server-4.3/dist/streaming_agent/avstreamLib/build/Release/avstream.node
ldd /root/owt-server-4.3/dist/streaming_agent/avstreamLib/build/Release/avstream.node
同时也可以增加到./scripts/pack.js脚本里面如下的环境变量里面
env['LD_LIBRARY_PATH'] = (env['LD_LIBRARY_PATH'] || '');
env['LD_LIBRARY_PATH'] = path.join(depsDir, 'lib') +
':' + path.join(rootDir, 'third_party/openh264') +
':' + path.join(rootDir, 'source/agent/sip/sipIn/build/Release/obj.target/') +
':' + path.join(rootDir, 'third_party/quic-lib/dist/lib') +
':' + env['LD_LIBRARY_PATH'];
至于前面编译的时候报错,一般都是nodejs安装的问题。可以参考下面的帖子安装相应的版本。
这个主要是根据owt对应需要的nodejs的版本安装。