简体   繁体   English

npm install robotsjs 在构建二进制文件时失败

[英]npm install robotjs failed duirng to building binaries

when I run the command "npm install robotjs -g" it gives me this error.当我运行命令“npm install robotsjs -g”时,它给了我这个错误。

robotjs@0.5.1 install C:\\Users\\Ehsan\\AppData\\Roaming\\npm\\node_modules\\robotjs prebuild-install || robots@0.5.1 安装 C:\\Users\\Ehsan\\AppData\\Roaming\\npm\\node_modules\\robotjs prebuild-install || node-gyp rebuild节点gyp重建

prebuild-install WARN install No prebuilt binaries found (target=8.11.3 runtime=node arch=x64 platform=win32) prebuild-install WARN install没有找到预构建的二进制文件(target=8.11.3 runtime=node arch=x64 platform=win32)

C:\\Users\\Ehsan\\AppData\\Roaming\\npm\\node_modules\\robotjs>if not defined npm_config_node_gyp (node "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin\\....\\node_modules\\node-gyp\\bin\\node-gyp.js" rebuild ) else (node "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" rebuild ) C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\input.py:891: Warning: 'as' will become a reserved keyword in Python 2.6 Traceback (most recent call last): File "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py", line 13, in import gyp File "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\pylib\\gyp__init__.py", line 8, in import gyp.input File "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\input.py", line 891 except ImportError as e: ^ SyntaxError: invalid syntax gyp ERR! C:\\Users\\Ehsan\\AppData\\Roaming\\npm\\node_modules\\robotjs>如果没有定义 npm_config_node_gyp(节点“C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin\\.. ..\\node_modules\\node-gyp\\bin\\node-gyp.js" 重建) else (节点"C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js"重建) C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\input.py:891: 警告:'as' 将成为 Python 2.6 Traceback 中的保留关键字(最近一次调用): 文件“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 行,在 import gyp.input 文件“C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\pylib\\gyp\\input”中。 py”,第 891 行除了 ImportError 作为 e: ^ SyntaxError: invalid syntax gyp ERR! configure error gyp ERR!配置错误gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR!堆栈错误: gyp失败,退出代码:1 gyp ERR! stack at ChildProcess.onCpExit (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\configure.js:336:16) gyp ERR!堆栈在 ChildProcess.onCpExit (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\configure.js:336:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR!堆栈在emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR!堆栈在 ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Windows_NT 10.0.17133 gyp ERR!系统 Windows_NT 10.0.17133 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR!命令 "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "重建" gyp ERR! cwd C:\\Users\\Ehsan\\AppData\\Roaming\\npm\\node_modules\\robotjs gyp ERR! cwd C:\\Users\\Ehsan\\AppData\\Roaming\\npm\\node_modules\\robotjs gyp ERR! node -v v8.11.3 gyp ERR!节点 -v v8.11.3 gyp 错误! node-gyp -v v3.6.2 gyp ERR! node-gyp -v v3.6.2 gyp 错误! not ok npm ERR!不好 npm ERR! code ELIFECYCLE npm ERR!代码 ELIFECYCLE npm ERR! errno 1 npm ERR!错误号 1 npm 错误号! robotjs@0.5.1 install: prebuild-install || node-gyp rebuild Robotjs@0.5.1 安装: prebuild-install || node-gyp rebuild prebuild-install || node-gyp rebuild npm ERR! prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR!退出状态 1 npm ERR! npm ERR! npm 错误! Failed at the robotjs@0.5.1 install script.在robotjs@0.5.1 安装脚本中失败。 npm ERR! npm 错误! This is probably not a problem with npm.这可能不是 npm 的问题。 There is likely additional logging output above.上面可能有额外的日志输出。

npm ERR! npm 错误! A complete log of this run can be found in: npm ERR!可以在以下位置找到此运行的完整日志:npm ERR!
C:\\Users\\Ehsan\\AppData\\Roaming\\npm-cache_logs\\2018-10-29T09_19_13_980Z-debug.log C:\\Users\\Ehsan\\AppData\\Roaming\\npm-cache_logs\\2018-10-29T09_19_13_980Z-debug.log

I was able to install (and run) robotjs in ubuntu 20.04:我能够在 ubuntu 20.04 中安装(并运行)robotjs:

sudo apt install -y nodejs npm
sudo apt install -y libxtst-dev
sudo apt install -y libpng++-dev
npm install robotjs

Got some warnings, but robotjs was successfully installed :)收到一些警告,但robotjs 已成功安装:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM