FAQ常見問題解答---搭建hubot

 一、node

[root@test160 ~]# npm install -g n npm 
ERR! Error: CERT_UNTRUSTED

證書不受信任的web

解決辦法:redis

npm config set strict-ssl false

 

 二、shell

npm install -g hubot coffee-script yo generator-hubot

查看日誌報錯信息 npm

...
14980 silly addNameRange number 2 { name: 'sindresorhus/is',
14980 silly addNameRange   range: '>=0.7.0-0 <0.8.0-0',
14980 silly addNameRange   hasData: true }
14981 silly addNameRange versions [ undefined, [] ]
14982 error TypeError: Cannot read property 'latest' of undefined
14982 error     at next (/usr/lib/node_modules/npm/lib/cache.js:687:35)
14982 error     at /usr/lib/node_modules/npm/lib/cache.js:675:5
14982 error     at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7)
...

緣由:gcc版本過低,須要升級到4.9以上json

 

 三、服務器

Error: CERT_NOT_YET_VALID

緣由:服務器時間設置錯誤session

 

四、app

Your hubot-scripts.json is empty, so you just need to remove it. 
[Tue Apr 03 2018 18:18:50 GMT+0800 (CST)] ERROR hubot-heroku-keepalive included, but missing HUBOT_HEROKU_KEEPALIVE_URL. `heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s | grep web.url | cut -d= -f2)` 
[Tue Apr 03 2018 18:18:50 GMT+0800 (CST)] INFO hubot-redis-brain: Using default redis on localhost:6379

  

出現的錯誤信息是由於默認狀況下,hubot使用redis作持久化存儲,並支持heroku部署。tcp

咱們能夠去掉redis和heroku配置,在./external-scripts.json文件中找到"hubot-heroku-keepalive"和"hubot-redis-brain"並刪除便可。

 

五、

xiaojiang> xiaojiang shellcmd update 

xiaojiang> spawn!

緣由待查

 

六、 

ERROR Error: listen EADDRINUSE 0.0.0.0:8080  

上面提示 8080 端口被佔用了    

[www@test160 handlers]$ netstat -ntlp|grep node
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:8100                0.0.0.0:*                   LISTEN      8008/node           
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      11651/node

能夠指定端口執行,好比換 8100 端口:

[www@test160 hubot]$ PORT=8100 ./bin/hubot

 

七、tmux裏執行報錯

sessions should be nested with care, unset $TMUX to force 

  

解決: 殺掉進程後執行unset TMUX,而後再執行tmux attach就能夠了

相關文章
相關標籤/搜索