1、
[root@test160 ~]# npm install -g n npm
ERR! Error: CERT_UNTRUSTED
证书不受信任的
解决办法:
npm config set strict-ssl false
2、
npm install -g hubot coffee-script yo generator-hubot
查看日志报错信息
...
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以上
3、
Error: CERT_NOT_YET_VALID
原因:服务器时间设置错误
4、
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部署。
我们可以去掉redis和heroku配置,在./external-scripts.json文件中找到"hubot-heroku-keepalive"和"hubot-redis-brain"并删除即可。
5、
xiaojiang> xiaojiang shellcmd update xiaojiang> spawn!
原因待查
6、
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
7、tmux里执行报错
sessions should be nested with care, unset $TMUX to force
解决: 杀掉进程后执行unset TMUX,然后再执行tmux attach就可以了