Open gokul-3 opened 9 months ago
window OS?need build 需要编译 node-gyp 工具
wtf dude? speak English please
@gokul-3 what #include <X11/Xutil.h> means? Is there any dependency for this package
that's a C header for X11, which is required to build robotjs on your Linux machine. You'll have to install it using whichever package management your distribution uses.
As an alternative, nut.js is fully prebuilt for macOS, Windows and Linux and provides an actively maintained alternative to robotjs
We also maintain a working fork of RobotJS, which is actively maintained as we use it in several of our projects. https://github.com/hurdlegroup/robotjs
It includes many of the fixes and uses NAPI, and includes prebuilt binaries for all available platforms
作业已收到,请利用假期充实自己,你的时间由你自己掌控
Robotjs (https://github.com/octalmage/robotjs)is build use V8 API.So it must be rebuilt for different Node versions. This is a big trouble when installing on a platform that has no build environment.. So I rewrapped Robotjs with Node API and prebuilt it. Now you can install robotjs_addon with just one command npm install robotjs_addon And it is compatible with different Node versions. It's open source. You can check it out if you are interested.https://github.com/ftyszyx/robotjs Warm: some api is removed,because there is no need for me, you can help to improve.
作业已收到,请利用假期充实自己,你的时间由你自己掌控
When I try to install robotjs, it ends with error
npm ERR! code 1 npm ERR! path /home/gokulakannan/robot/node_modules/robotjs npm ERR! command failed npm ERR! command sh -c prebuild-install || node-gyp rebuild npm ERR! make: Entering directory '/home/gokulakannan/robot/node_modules/robotjs/build' npm ERR! CXX(target) Release/obj.target/robotjs/src/robotjs.o npm ERR! make: Leaving directory '/home/gokulakannan/robot/node_modules/robotjs/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@10.0.1 npm ERR! gyp info using node@20.7.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/gokulakannan/robot/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/gokulakannan/robot/node_modules/robotjs/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/gokulakannan/robot/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/gokulakannan/.cache/node-gyp/20.7.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/gokulakannan/.cache/node-gyp/20.7.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/gokulakannan/robot/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/gokulakannan/.cache/node-gyp/20.7.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/gokulakannan/robot/node_modules/robotjs', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! cc1plus: warning: command-line option ‘-Wbad-function-cast’ is valid for C/ObjC but not for C++ npm ERR! In file included from ../src/keypress.h:6, npm ERR! from ../src/robotjs.cc:7: npm ERR! ../src/keycode.h:112:10: fatal error: X11/Xutil.h: No such file or directory npm ERR! 112 | #include <X11/Xutil.h> npm ERR! | ^ (/home/gokulakannan/robot/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 6.1.0-1029-oem
npm ERR! gyp ERR! command "/usr/local/lib/node_modules/node/bin/node" "/home/gokulakannan/robot/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/gokulakannan/robot/node_modules/robotjs
npm ERR! gyp ERR! node -v v20.7.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
~~~~ npm ERR! compilation terminated. npm ERR! make: *** [robotjs.target.mk:135: Release/obj.target/robotjs/src/robotjs.o] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error:make
failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.what
#include <X11/Xutil.h>
means? Is there any dependency for this package