Hubot入门

我只是从github 下载hubot 。 我从\d\projects\hubot运行了npm install ,结果出现错误。 第一个错误可能导致其余的:

d:\ projects \ hubot \ node_modules \ hubot-hipchat \ node_modules \ node-xmpp \ node_modules \ node-xmpp-core \ node_modules \ node-stringprep> node“d:\ Program Files \ nodejs \ node_modules \ npm \ bin \ node -gyp-> bin \ …. \ node_modules \ node-gyp \ bin \ node-gyp.js“rebuild gyp ERR! configuration错误gyp ERR! 堆栈错误:命令失败:gyp ERR! 堆栈在ChildProcess.exithandler(child_process.js:647:15)gyp ERR! 堆栈在ChildProcess.emit(events.js:98:17)gyp ERR! stack at maybeClose(child_process.js:755:16)gyp ERR! 堆栈在Socket。 (child_process.js:968:11)gyp ERR! 堆栈在Socket.emit(events.js:95:17)gyp ERR! 堆栈在Pipe.close(net.js:465:12)gyp ERR! 系统Windows_NT 6.1.7601 gyp ERR! 命令“node”“d:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“rebuild”gyp ERR! cwd d:\ projects \ hubot \ node_modules \ hubot-hipchat \ node_modules \ node-xmpp \ node_modules \ node-xmpp-core \ node_modules \ node-stringprep gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v0.13.1 gyp ERR! 不好

第一行指向我的机器上不存在的文件夹:

d:\projects\hubot\node_modules\hubot-hipchat\node_modules\node-xmpp\node_modules\node-xmpp-core

node-xmpp-core不存在。 我试着安装node-xmpp-clientnode-xmpp-sever然后再次发现大量的错误。

任何想法我怎么能到这混乱的底部?

原来我是从错误的命令开始的。

Mac安装程序

下拉回购后,正确的命令开始是:

sudo npm install -g yo generator-hubot

其他你需要的东西:

  • 的node.js
  • NPM
  • Coffeescript :sudo npm install -g coffee-script
  • Redis的

这是事情变得棘手的地方。

  • mkdir myhubot
  • CD myhubot
  • 哟hubot –owner =“Bot Wrangler”–name =“Hubot”–description =“令人高兴的robutt”–adapter = campfire – 默认

(哟hubot命令安装hubot!)

现在切换回根目录 \ where \ hubot

  • npm安装(安装所有其他位hubot也需要)

切换回 \ hubot \ myhubot \ 创build的目录 \

  • 执行hubot: – bin/hubot (安装npm依赖项,加载脚本,启动hubot)

这会让你提示,屏幕上会出现一堆垃圾。 点击<enter> 现在你得到正确的提示…

Hubot> ,你可以input“hubot help”来testing他。

如果hubot没有对命令作出响应,请检查以确保从\wherever\hubot\myhubot创build的目录运行bin/hubot \wherever\hubot\myhubot 。 您可以从根目录运行bin/hubot ,但提示不会响应命令。

完整的设置说明在github上find。

Windows安装程序

基本上是一样的事情。 在上面列出的任何命令之前不要使用sudo。 在Hubot运行之前,您还需要另外两个软件包。 我build议先安装这些:

  1. 安装Python 3.2: https : //www.python.org/download/releases/3.2/
  2. 安装LMXL: https ://pypi.python.org/pypi/lxml/3.4.2(与Python 3.2相关的一个)

写一些脚本 ,使他做有趣的事情。

  • \wherever\hubot\myhubot\scripts\example.coffee是一个很好的开始