facebook twitter hatena line email

「Mac/インストール/nodejs」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(nodebrewインストール)
(nodebrewインストール)
行12: 行12:
  
 
  $ vi ~/.bash_profile
 
  $ vi ~/.bash_profile
export PATH=/usr/local/var/nodebrew/current/bin:$PATH
 
 
  export PATH=$HOME/.nodebrew/current/bin:$PATH
 
  export PATH=$HOME/.nodebrew/current/bin:$PATH
 
  $ source .bash_profile
 
  $ source .bash_profile

2019年3月18日 (月) 10:37時点における版

nodejsインストール

$ brew install node
$ node -v
v0.10.22

nodebrewインストール

nodejsの複数バージョンを管理したい場合は、brew install nodeでなくこちらを

$ brew install nodebrew
$ brew list
$ nodebrew setup
$ vi ~/.bash_profile
export PATH=$HOME/.nodebrew/current/bin:$PATH
$ source .bash_profile

nodebrewを使ってnodeをインストール

$ nodebrew install-binary stable #安定版
$ nodebrew list
$ nodebrew use stable #どれを使うか
$ node -v

場所

/usr/local/share/npm/bin