nodebrewを使うとrbenvのようにnode.jsのバージョンを選択できる。
curl -L https://raw.githubusercontent.com/hokaccha/nodebrew/master/nodebrew | perl - setup
デフォルトでは$HOME/.nodebrewにインストールされるが、変更したい場合は環境変数を設定しておく
export NODEBREW_ROOT=/path/to/.nodebrew
nodebrew ls-remote
nodebrew install-binary v0.12.0
Node.js configure error: No acceptable C compiler found!
Please make sure you have a C compiler installed on your system and/or
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.
python ./configure
Node.js configure error: No acceptable C compiler found!
Please make sure you have a C compiler installed on your system and/or
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.
python tools/gyp_node.py -f make
gyp: Undefined variable node_tag in /home/buildusr01/.nodebrew/src/v0.10.27/node-v0.10.27/node.gyp
make: *** [out/Makefile] Error 1
| nodebrew ls | show version list(local) |
| nodebrew ls-remote | show all version(remote) |
nodebrew ls v0.12.0 current: none nodebrew use v0.12.0
| グローバルのnode_moduleの場所 | npm root -g |
| グローバルのnode_moduleパス。PATHに表示結果の場所を通す | npm bin -g |
| 設定値の確認 | npm config list -l |
| インストール済みパッケージ表示 | npm info grunt-cli |
| バージョン指定してインストール | npm install -g [email protected] |
| パッケージアンインストール | npm uninstall パッケージ名 |
| gruntインストール | npm install -g grunt-cli |
依存関係にあるモジュールをインストールするのだが、一筋縄ではいかないことが多い。 unmet dependencyとでていたらそのモジュールはインストールできていない。
grunt-contrib-imageminをインストールしたが、imagemin-gifsicleがインストールされず、手動インストール
I solved this by going into grunt-contrib-imagemin/node_modules/imagemin and perform:
npm install imagemin-gifsicle@
just substitute with the latest version number from https://www.npmjs.com/package/imagemin-gifsicle
npm install -g [email protected]