mac操作系统Catalina 10.15.7上的mac屏幕捕获权限模块make失败



我想从github运行jitsi-meet电子项目。因此,我尝试在我的项目目录中安装npm,以安装必要的节点模块包。在此期间,发生了以下错误。

错误:函数"CGPreflightScreenCaptureAccess"的隐式声明在C99中无效[-Werror,-Wimplicit函数声明]hasPermissions=CGPreflightScreenCaptureAccess((;

在package.json文件中:"mac屏幕捕获权限":"1.1.0";

完全错误:

> mac-screen-capture-permissions@1.1.0 install /Users/apple01/Documents/Boithok/jitsi-meet-electron-master/node_modules/mac-screen-capture-permissions
> prebuild-install || node install.js
prebuild-install WARN install No prebuilt binaries found (target=14.16.1 runtime=node arch=x64 libc= platform=darwin)
> mac-screen-capture-permissions@1.1.0 native_build /Users/apple01/Documents/Boithok/jitsi-meet-electron-master/node_modules/mac-screen-capture-permissions
> node-gyp rebuild
CXX(target) Release/obj.target/screencapturepermissions/screen-capture-permissions.o
../screen-capture-permissions.m:12:22: error: implicit declaration of function 'CGPreflightScreenCaptureAccess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
hasPermissions = CGPreflightScreenCaptureAccess();
^
1 error generated.
make: *** [Release/obj.target/screencapturepermissions/screen-capture-permissions.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node@14/14.16.1_1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/Cellar/node@14/14.16.1_1/bin/node" "/usr/local/Cellar/node@14/14.16.1_1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/apple01/Documents/Boithok/jitsi-meet-electron-master/node_modules/mac-screen-capture-permissions
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mac-screen-capture-permissions@1.1.0 native_build: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mac-screen-capture-permissions@1.1.0 native_build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/apple01/.npm/_logs/2021-05-04T05_46_57_224Z-debug.log
> robotjs@0.6.0 install /Users/apple01/Documents/Boithok/jitsi-meet-electron-master/node_modules/robotjs
> prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=14.16.1 runtime=node arch=x64 libc= platform=darwin)
CXX(target) Release/obj.target/robotjs/src/robotjs.o
CC(target) Release/obj.target/robotjs/src/deadbeef_rand.o
CC(target) Release/obj.target/robotjs/src/mouse.o
CC(target) Release/obj.target/robotjs/src/keypress.o
CC(target) Release/obj.target/robotjs/src/keycode.o
CC(target) Release/obj.target/robotjs/src/screen.o
CC(target) Release/obj.target/robotjs/src/screengrab.o
CC(target) Release/obj.target/robotjs/src/snprintf.o
CC(target) Release/obj.target/robotjs/src/MMBitmap.o
SOLINK_MODULE(target) Release/robotjs.node

该模块不会在macOS 10.15.7上编译,因为CGPreflightScreenCaptureAccess在该版本上不可用。在运行时,模块在调用API之前检查macOS版本,这样它就不会崩溃。

从源代码构建模块需要macOS 11+SDK,但生成的模块仍将在<10.15、10.15和11+。

最新更新