yoでhubot作成時のエラーの対処


hubot構築に伴い、環境は AWS EC2 Amazon linux を選択しました。

構築は、下部の参考サイトにある通り、Amazon linuxの場合は、順々にインストールを進められました。

#mkdir ichigo
#cd ichigo
#yo hubot

が、yo hubot で下記エラーになりました。

Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/yo/node_modules/tabtab/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details

Error: EACCES, permission denied '/root/.config'
    at Object.fs.mkdirSync (fs.js:654:18)
    at sync (/usr/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:77:24)
    at Object.create.all.get (/usr/lib/node_modules/yo/node_modules/configstore/index.js:38:13)
    at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/index.js:27:44)
    at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:37:34)
    at Object.<anonymous> (/usr/lib/node_modules/yo/lib/cli.js:172:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

エラーの原因は、rootユーザで行なっていた為でした。
ec2-user でやり直して、hubot構築完了となりました。
本来であれば、hubotユーザを作ってやるべきですね。

下記サイトがとても参考になりました。
【初心者向け】AWS+Hubot+Slackで自動返信するBOTの作り方(後半)