-Node.jsについて

*コマンド一覧 [#i8b3994b]


*インストール [#m55df346]

nodebrewを使うとrbenvのようにnode.jsのバージョンを選択できる。


*nodebrew [#e66896f7]

**install [#z7871826]

 curl -L https://raw.githubusercontent.com/hokaccha/nodebrew/master/nodebrew  | perl  - setup

**node.jsのインストール [#b09ce3ee]

-インストールできるバージョンの確認

 nodebrew ls-remote

-インストール

 nodebrew install-binary v0.12.0


-当たり前だが、gccが必要。ないときは以下のエラーが出てしまう。

 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

**usage [#vda2cd06]

|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

*npm [#f869c527]


|設定値の確認|npm config list -l|
|インストール済みパッケージ表示|npm info grunt-cli|
|バージョン指定してインストール|npm install -g npm@1.4.25|
|パッケージアンインストール|npm uninstall パッケージ名|
|gruntインストール|npm install -g grunt-cli|


**不具合 [#o97f3bae]

依存関係にあるモジュールをインストールするのだが、一筋縄ではいかないことが多い。
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


*設定など [#ke2e15d4]


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS