わーくあうと!

日々の作業でためになったことをアウトプットすることで自分の成長につながればなと。

pm2のインストールでこける件

node.jsをデーモン化するにはforeverよりpm2のほうが高機能でいいよという噂を耳にしたのでpm2を入れようとしたら失敗した。

$npm install -g pm2
〜省略〜
> usage@0.3.9 install /root/.nvm/v0.10.22/lib/node_modules/pm2/node_modules/usage
> node-gyp rebuild

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F (/root/.nvm/v0.10.22/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack     at E (/root/.nvm/v0.10.22/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /root/.nvm/v0.10.22/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Linux 2.6.32-358.2.1.el6.x86_64
gyp ERR! command "node" "/root/.nvm/v0.10.22/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/.nvm/v0.10.22/lib/node_modules/pm2/node_modules/usage
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok 
npm ERR! usage@0.3.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the usage@0.3.9 install script.
npm ERR! This is most likely a problem with the usage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls usage
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-358.2.1.el6.x86_64
npm ERR! command "/root/.nvm/v0.10.22/bin/node" "/root/.nvm/v0.10.22/bin/npm" "install" "-g" "pm2"
npm ERR! cwd /var/www/chat-server
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm http 200 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz
npm http 200 https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/chat-server/npm-debug.log
npm ERR! not ok code 0

こんなエラー。
makeが無いとか言ってるけど、まぁとりあえず Development Tools 入れてみるかーと思い以下をインストール

$ yum groupinstall "Development tools"

それで

$ npm install -g pm2

したらインストール成功した。