Ehs*_*har 5 javascript backend node.js npm
当我运行命令“npm install robotsjs -g”时,它给了我这个错误。
robots@0.5.1 安装 C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs prebuild-install || 节点gyp重建
prebuild-install WARN install没有找到预构建的二进制文件 (target=8.11.3 runtime=node arch=x64 platform=win32)
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:\错误:
gyp退出代码失败:1 gyp ERR!堆栈在 ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16) gyp ERR!堆栈在emitTwo (events.js:126:13) gyp ERR!堆栈在 ChildProcess.emit (events.js:214:7) gyp ERR!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR!系统 Windows_NT 10.0.17133 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!节点 -v v8.11.3 gyp 错误!node-gyp -v v3.6.2 gyp 错误!不好 npm ERR!代码 ELIFECYCLE npm ERR!错误号 1 npm 错误!Robotjs@0.5.1 安装:prebuild-install || node-gyp rebuildnpm 错误!退出状态 1 npm ERR!npm 错误!在robotjs@0.5.1 安装脚本中失败。npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!
C:\Users\Ehsan\AppData\Roaming\npm-cache_logs\2018-10-29T09_19_13_980Z-debug.log
小智 1
我能够在 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
Run Code Online (Sandbox Code Playgroud)
收到一些警告,但 robotsjs 已成功安装:)