xserver に nodejs インストール
レンタルサーバーエックスサーバーの題にしてるけど、エックス以外のレンタル・レンタルじゃないサーバーでもいけます。
vuejs react が流行ってる今、nodejs は web 開発に不可欠な存在!
まあ、余計な話なしで GO!
nodebrew という便利ツール インストール
エックスサーバーは curl 使えないが、別のサーバーで curl 使える環境なら
ここからエックスサーバーに node 入れる作業
curl なしなら wget と perl の組み合わせ拳法でダウンロード&インストール!
これでインストール完了ですが、あと少し
nodebrew のパス通す
インストール完了したら、注意書きで教えてくれたパスを通す
これで nodebrew 使えるようになった! 🎉
nodebrew help の出力
インストール完了したら、とりあえず help 見るべし
うん。。。よく分かる?よくわからない?
親切に使い方の例教えてくれたようで
nodebrew install v8.9.4
で叩くと nodejs v8.9.4 がインストールされる!
あと一歩!
nodebrew 使い方
nodejs いろんなバージョンインストールしてみる
- latest 最新バージョン
- stable 安定バージョン
- v8.9 バージョン 8.9 指定
- 8.9.4
v
なしでバージョン指定
大体こんな感じ
インストールしたパッケージ確認
nodebrew にインストールしたパッケージ一覧
nodebrew で使うバージョンを指定
nodejs npm 入ってること確認
入れました入れました
さあ、本当に入ってる?
確認
入ってる入ってる!OK 完了!
nodebrew コマンド一覧
コマンド | 説明 |
nodebrew help | Show this message |
nodebrew install <version> | Download and install <version> (from binary) |
nodebrew compile <version> | Download and install <version> (from source) |
nodebrew install-binary <version> | Alias of install (For backward compatibility) |
nodebrew uninstall <version> | Uninstall <version> |
nodebrew use <version> | Use <version> |
nodebrew list | List installed versions |
nodebrew ls | Alias for list |
nodebrew ls-remote | List remote versions |
nodebrew ls-all | List remote and installed versions |
nodebrew alias <key> <value> | Set alias |
nodebrew unalias <key> | Remove alias |
nodebrew clean <version> | all | Remove source file |
nodebrew selfupdate | Update nodebrew |
nodebrew migrate-package <version> | Install global NPM packages contained in <version> to current version |
nodebrew exec <version> -- <command> | Execute <command> using specified <version> |
nodebrew (opens new window)