当我运行命令“-g”时,它会给出这个错误。
robotjs@0.5.1安装C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs预构建- install区区节点-gyp重新构建前-安装警告安装没有预置二进制文件找到 (target=8.11.3 runtime=node arch=x64 platform=win32) C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs>if未定义的npm_config_node_gyp (节点"C:\Program重建)其他(节点“C:\ProgramFiles\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js”)重建)C:\ Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py:891:警告:'as‘将成为Python2.6回溯中的保留关键字(最近一次调用):文件"C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py",“第13行,在导入gyp文件"C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp__init__.py",第8行,导入gyp.input文件“C:\gyp.input第891行中,除ImportError作为e:^ SyntaxError:无效语法gyp.input错误!配置错误绞盘错误!堆栈错误:
gyp
失败,退出代码:1,gyp!堆栈在Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16) ChildProcess.onCpExit (C:\Program )在emitTwo (events.js:126:13)健身房堆放错误!在ChildProcess.emit (events.js:214:7)健身房堆放错误!堆栈在Process.ChildProcess._handle.onexit (内部/子流程.12:198:12)系统Windows_NT 10.0.17133号错误!命令“C:\ Files\nodejs\node.exe”"C:\Program Files\nodejs\node.exe“"rebuild”gyp!cwd C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs绞车!节点-v v8.11.3gyperr!node -v v3.6.2gyp错误!不,npm,错误!代码ELIFECYCLE npm错误!错误1国家预防机制错误!robotjs@0.5.1安装:prebuild-install || node-gyp rebuild
npm!退出状态1 npm错误!npm错误!robotjs@0.5.1安装脚本失败。npm错误!这可能不是国家预防机制的问题。上面可能有额外的日志输出。 npm错误!这个运行的完整日志可以在: npm中找到! C:\Users\Ehsan\AppData\Roaming\npm-cache_logs\2018-10-29T09_19_13_980Z-debug.log
发布于 2021-08-23 15:38:43
我能够在ubuntu20.04中安装(并运行) robotjs:
sudo apt install -y nodejs npm
sudo apt install -y libxtst-dev
sudo apt install -y libpng++-dev
npm install robotjs
收到一些警告,但robotjs已成功安装:)
https://stackoverflow.com/questions/53042326
复制相似问题