agora 本地服务器录制 跑nodejsdemo,集成sdk时 报错,不能生成agorasdk.node

[root@instance-yzwu6c6w record]# ./build.sh
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.0 | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.0 | linux | x64
gyp info find Python using Python version 2.7.5 found at “/usr/bin/python”
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args ‘/data/node-v12.16.0-linux-x64/lib/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 ‘/data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/build/config.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/data/node-v12.16.0-linux-x64/lib/node_modules/node-gyp/addon.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/root/.cache/node-gyp/12.16.0/include/node/common.gypi’,
gyp info spawn args ‘-Dlibrary=shared_library’,
gyp info spawn args ‘-Dvisibility=default’,
gyp info spawn args ‘-Dnode_root_dir=/root/.cache/node-gyp/12.16.0’,
gyp info spawn args ‘-Dnode_gyp_dir=/data/node-v12.16.0-linux-x64/lib/node_modules/node-gyp’,
gyp info spawn args ‘-Dnode_lib_file=/root/.cache/node-gyp/12.16.0/<(target_arch)/node.lib’,
gyp info spawn args ‘-Dmodule_root_dir=/data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src’,
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 ok
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.0 | linux | x64
make: Entering directory /data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/build' gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] CXX(target) Release/obj.target/agorasdk/agora_node_ext/AgoraSdk.o In file included from ../agora_node_ext/AgoraSdk.cpp:11:0: .**./agora_node_ext/AgoraSdk.h:14:23: fatal error: base/log.h: No such file or directory** ** #include "base/log.h"** ^ compilation terminated. make: *** [Release/obj.target/agorasdk/agora_node_ext/AgoraSdk.o] Error 1 make: Leaving directory/data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/data/node-v12.16.0-linux-x64/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 3.10.0-1062.4.1.el7.x86_64
gyp ERR! command “/data/node-v12.16.0-linux-x64/bin/node” “/data/node-v12.16.0-linux-x64/bin/node-gyp” “build”
gyp ERR! cwd /data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src
gyp ERR! node -v v12.16.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
cp: cannot stat ‘build/Release/agorasdk.node’: No such file or directory
[root@instance-yzwu6c6w record]#

不能生成agorasdk.node

这个报错是因为没有正确导入 SDK。log.h 文件是在 SDK 文件夹内的:

请参考 readme 中的运行步骤:
https://github.com/AgoraIO/Basic-Recording/blob/master/On-Premise-Recording-Nodejs/README_zh.md

现在下载下来的没有这个log.h文件,我是去年9月份下载了一份,找到了这个log.h文件。现在执行后还是不成功。如果你是声网的大神,麻烦你下载下来看下是不是下载包有问题呢。

[root@instance-yzwu6c6w record]# ./build.sh
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.0 | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.0 | linux | x64
gyp info find Python using Python version 2.7.5 found at “/usr/bin/python”
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args ‘/data/node-v12.16.0-linux-x64/lib/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 ‘/data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/build/config.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/data/node-v12.16.0-linux-x64/lib/node_modules/node-gyp/addon.gypi’,
gyp info spawn args ‘-I’,
gyp info spawn args ‘/root/.cache/node-gyp/12.16.0/include/node/common.gypi’,
gyp info spawn args ‘-Dlibrary=shared_library’,
gyp info spawn args ‘-Dvisibility=default’,
gyp info spawn args ‘-Dnode_root_dir=/root/.cache/node-gyp/12.16.0’,
gyp info spawn args ‘-Dnode_gyp_dir=/data/node-v12.16.0-linux-x64/lib/node_modules/node-gyp’,
gyp info spawn args ‘-Dnode_lib_file=/root/.cache/node-gyp/12.16.0/<(target_arch)/node.lib’,
gyp info spawn args ‘-Dmodule_root_dir=/data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src’,
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 ok
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.16.0 | linux | x64
make: Entering directory /data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/build' gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] CXX(target) Release/obj.target/agorasdk/agora_node_ext/AgoraSdk.o In file included from ../agora_node_ext/node_async_queue.h:24:0, from ../agora_node_ext/AgoraSdk.cpp:12: ../agora_node_ext/node_log.h:37:0: warning: "LOG_WARNING" redefined [enabled by default] #define LOG_WARNING(format, ...) log(LOG_LEVEL_WARNING, format, ##__VA_ARGS__) ^ In file included from /usr/include/syslog.h:1:0, from ../sdk/include/base/log.h:11, from ../agora_node_ext/AgoraSdk.h:14, from ../agora_node_ext/AgoraSdk.cpp:11: /usr/include/sys/syslog.h:55:0: note: this is the location of the previous definition #define LOG_WARNING 4 /* warning conditions */ ^ In file included from ../agora_node_ext/node_async_queue.h:24:0, from ../agora_node_ext/AgoraSdk.cpp:12: ../agora_node_ext/node_log.h:42:0: warning: "LOG_INFO" redefined [enabled by default] #define LOG_INFO(format, ...) log(LOG_LEVEL_INFO, format, ##__VA_ARGS__) ^ In file included from /usr/include/syslog.h:1:0, from ../sdk/include/base/log.h:11, from ../agora_node_ext/AgoraSdk.h:14, from ../agora_node_ext/AgoraSdk.cpp:11: /usr/include/sys/syslog.h:57:0: note: this is the location of the previous definition #define LOG_INFO 6 /* informational */ ^ ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:48:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [2])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:192:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_ERROR, int32, error, int32, stat_code); ^ ../agora_node_ext/AgoraSdk.cpp:48:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:192:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_ERROR, int32, error, int32, stat_code); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:48:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [2])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:205:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_JOIN_CHANNEL, string, channelName.c_str(), uid, uid); ^ ../agora_node_ext/AgoraSdk.cpp:48:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:205:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_JOIN_CHANNEL, string, channelName.c_str(), uid, uid); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:25:79: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, std::nullptr_t)’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 0, nullptr);\ ^ ../agora_node_ext/AgoraSdk.cpp:212:9: note: in expansion of macro ‘MAKE_JS_CALL_0’ MAKE_JS_CALL_0(REC_EVENT_LEAVE_CHANNEL); ^ ../agora_node_ext/AgoraSdk.cpp:25:79: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 0, nullptr);\ ^ ../agora_node_ext/AgoraSdk.cpp:212:9: note: in expansion of macro ‘MAKE_JS_CALL_0’ MAKE_JS_CALL_0(REC_EVENT_LEAVE_CHANNEL); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:36:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [1])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 1, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:230:9: note: in expansion of macro ‘MAKE_JS_CALL_1’ MAKE_JS_CALL_1(REC_EVENT_USER_JOIN, uid, uid); ^ ../agora_node_ext/AgoraSdk.cpp:36:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 1, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:230:9: note: in expansion of macro ‘MAKE_JS_CALL_1’ MAKE_JS_CALL_1(REC_EVENT_USER_JOIN, uid, uid); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:36:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [1])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 1, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:243:9: note: in expansion of macro ‘MAKE_JS_CALL_1’ MAKE_JS_CALL_1(REC_EVENT_USER_LEAVE, uid, uid); ^ ../agora_node_ext/AgoraSdk.cpp:36:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 1, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:243:9: note: in expansion of macro ‘MAKE_JS_CALL_1’ MAKE_JS_CALL_1(REC_EVENT_USER_LEAVE, uid, uid); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:36:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [1])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 1, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:249:9: note: in expansion of macro ‘MAKE_JS_CALL_1’ MAKE_JS_CALL_1(REC_EVENT_ACTIVE_SPEAKER, uid, uid); ^ ../agora_node_ext/AgoraSdk.cpp:36:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 1, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:249:9: note: in expansion of macro ‘MAKE_JS_CALL_1’ MAKE_JS_CALL_1(REC_EVENT_ACTIVE_SPEAKER, uid, uid); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:48:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [2])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:372:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_ERROR, int32, err, int32, stat_code); ^ ../agora_node_ext/AgoraSdk.cpp:48:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:372:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_ERROR, int32, err, int32, stat_code); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In member function ‘void agora::AgoraSdk::onAudioVolumeIndication_node(const agora::linuxsdk::AudioVolumeInfo*, unsigned int)’: ../agora_node_ext/AgoraSdk.cpp:383:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < speakerNumber; i++) { ^ ../agora_node_ext/AgoraSdk.cpp:385:101: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated (declared at /root/.cache/node-gyp/12.16.0/include/node/v8.h:3498): Use maybe version [-Wdeprecated-declarations] obj->Set(napi_create_string_(isolate, "uid"), napi_create_uid_(isolate, speakers[i].uid)); ^ ../agora_node_ext/AgoraSdk.cpp:386:110: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated (declared at /root/.cache/node-gyp/12.16.0/include/node/v8.h:3498): Use maybe version [-Wdeprecated-declarations] obj->Set(napi_create_string_(isolate, "volume"), napi_create_uint32_(isolate, speakers[i].volume)); ^ ../agora_node_ext/AgoraSdk.cpp:387:36: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated (declared at /root/.cache/node-gyp/12.16.0/include/node/v8.h:3507): Use maybe version [-Wdeprecated-declarations] arrSpeakers->Set(i, obj); ^ ../agora_node_ext/AgoraSdk.cpp:394:72: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [2])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv); ^ ../agora_node_ext/AgoraSdk.cpp:394:72: note: candidate is: In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In member function ‘virtual void agora::AgoraSdk::onAudioVolumeIndication(const agora::linuxsdk::AudioVolumeInfo*, unsigned int)’: ../agora_node_ext/AgoraSdk.cpp:401:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < speakerNum; i++) { ^ ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:75:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [4])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 4, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:415:9: note: in expansion of macro ‘MAKE_JS_CALL_4’ MAKE_JS_CALL_4(REC_EVENT_FIRST_VIDEO_FRAME, uid, uid, int32, width, int32, height, int32, elapsed); ^ ../agora_node_ext/AgoraSdk.cpp:75:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 4, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:415:9: note: in expansion of macro ‘MAKE_JS_CALL_4’ MAKE_JS_CALL_4(REC_EVENT_FIRST_VIDEO_FRAME, uid, uid, int32, width, int32, height, int32, elapsed); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:48:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [2])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:421:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_FIRST_AUDIO_FRAME, uid, uid, int32, elapsed); ^ ../agora_node_ext/AgoraSdk.cpp:48:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:421:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_FIRST_AUDIO_FRAME, uid, uid, int32, elapsed); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:48:76: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value> [2])’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:427:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_STREAM_CHANGED, bool, receivingAudio, bool, receivingVideo); ^ ../agora_node_ext/AgoraSdk.cpp:48:76: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 2, argv);\ ^ ../agora_node_ext/AgoraSdk.cpp:427:9: note: in expansion of macro ‘MAKE_JS_CALL_2’ MAKE_JS_CALL_2(REC_EVENT_STREAM_CHANGED, bool, receivingAudio, bool, receivingVideo); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:25:79: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, std::nullptr_t)’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 0, nullptr);\ ^ ../agora_node_ext/AgoraSdk.cpp:433:9: note: in expansion of macro ‘MAKE_JS_CALL_0’ MAKE_JS_CALL_0(REC_EVENT_CONN_LOST); ^ ../agora_node_ext/AgoraSdk.cpp:25:79: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 0, nullptr);\ ^ ../agora_node_ext/AgoraSdk.cpp:433:9: note: in expansion of macro ‘MAKE_JS_CALL_0’ MAKE_JS_CALL_0(REC_EVENT_CONN_LOST); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided ../agora_node_ext/AgoraSdk.cpp: In lambda function: ../agora_node_ext/AgoraSdk.cpp:25:79: error: no matching function for call to ‘v8::Function::Call(v8::Local<v8::Object>, int, std::nullptr_t)’ cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 0, nullptr);\ ^ ../agora_node_ext/AgoraSdk.cpp:439:9: note: in expansion of macro ‘MAKE_JS_CALL_0’ MAKE_JS_CALL_0(REC_EVENT_CONN_INTER); ^ ../agora_node_ext/AgoraSdk.cpp:25:79: note: candidate is: cb.callback.Get(isolate)->Call(cb.js_this.Get(isolate), 0, nullptr);\ ^ ../agora_node_ext/AgoraSdk.cpp:439:9: note: in expansion of macro ‘MAKE_JS_CALL_0’ MAKE_JS_CALL_0(REC_EVENT_CONN_INTER); ^ In file included from /root/.cache/node-gyp/12.16.0/include/node/node.h:63:0, from ../agora_node_ext/node_napi_api.h:17, from ../agora_node_ext/AgoraSdk.h:8, from ../agora_node_ext/AgoraSdk.cpp:11: /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: v8::MaybeLocal<v8::Value> v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, ^ /root/.cache/node-gyp/12.16.0/include/node/v8.h:4298:43: note: candidate expects 4 arguments, 3 provided make: *** [Release/obj.target/agorasdk/agora_node_ext/AgoraSdk.o] Error 1 make: Leaving directory/data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/data/node-v12.16.0-linux-x64/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:321:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 3.10.0-1062.4.1.el7.x86_64
gyp ERR! command “/data/node-v12.16.0-linux-x64/bin/node” “/data/node-v12.16.0-linux-x64/bin/node-gyp” “build”
gyp ERR! cwd /data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src
gyp ERR! node -v v12.16.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
cp: cannot stat ‘build/Release/agorasdk.node’: No such file or directory

现在最新下载的tar包里面是这样一个文件

,是一个隐藏的压缩文件
将文件名改为tar后,再次解压,里面才是这个image 文件夹

解压出来没有这个log.h文件
我找到以前下载下来包里的log.h文件夹拷过去,执行还是报错,报错结果是上一条回复的内容。

嗯确实,这个 github demo 还没有更新,适配的是 v2.3.4 的录制 SDK,还没有适配昨天发布的 v3.0.0。我们后续会让工程师更新一下 demo。

你那边有 v2.3.4 的录制 SDK 吗?先用 v2.3.4 的吧。或者自己稍微调整一下 demo 代码。

有个去年1月份,不知道行不行。没有v2.3.4的sdk,烦请你发一个给我吧,27788818@qq.com,谢谢

不好意思,附件有点大,发送失败了。。。这边申请加了你的 QQ,烦请通过一下,QQ 发给你。

我找到一个v2.3.4的sdk,生成了agorasdk.node,我往后面运行看看能成功不

好的,如果还有问题再联系。

请问用nodejs来做视频录制的后台程序坑多吗?用nodejs来做的多不多呢?

大部分用户是用 JAVA 或 C++ 来集成录制服务的。nodejs 是封装的 c++,使用 nodejs 很多功能 可能还需要改下面的 c++ 代码,个人是比较推荐直接集成 c++ ,或者如果命令行录制的功能满足的话 建议也可以用命令行集成(这种方式最简单)。

嗯,我先把sdkdemo跑起来再看。

[root@instance-yzwu6c6w record]# node sdkdemo.js
setting mix layout…
joinChannel…
appliteDir /data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk/bin/
pRecording->m_agorasdk->createChannel return result:1
Error: 13,with stat_code:3
err 13 3
leaveChannel…
(node:1882) UnhandledPromiseRejectionWarning: 13
(node:1882) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1882) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我已经在这里填入我的appid,但是报了上面的错。

这个问题是因为 录制子进程 AgoraCoreService 没有执行权限,需要加上执行权限
chmod a+x AgoraCoreService

[root@instance-yzwu6c6w record]# node sdkdemo.js
setting mix layout…
joinChannel…
appliteDir /data/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk/bin/
pRecording->m_agorasdk->createChannel return result:1
join channel Id: agoratest, with uid: 696381095
channel joined agoratest 696381095
leave channel with code:12
Error: 3,with stat_code:16
err 3 16
给AgoraCoreService加上权限后又出现这个错误码,:joy:

看下这个:https://docs.agora.io/cn/faqs/record_status_error#录制退出报错

image ,demo里这些功能都没有。

嗯,这个demo比较老了,我这边反馈一下,后续会更新的。

能增加对nodejs的支持吗?