脳汁portal

アメリカ在住(だった)新米エンジニアがその日学んだIT知識を書き綴るブログ

node.jsのインストール方法

# install ndenv
cd /usr/local/
git clone https://github.com/riywo/ndenv.git
chmod -R g+rwxXs /usr/local/ndenv/
mkdir /usr/local/ndenv/plugins
cd /usr/local/ndenv/plugins
git clone https://github.com/riywo/node-build.git
cat << "EOF" > /etc/profile.d/ndenv.sh
export NDENV_ROOT=/usr/local/ndenv
export PATH="$NDENV_ROOT/bin:$PATH"
eval "$(ndenv init -)"
EOF
source /etc/profile.d/ndenv.sh

# install node
ndenv install ${NODE_VERSION}
ndenv global ${NODE_VERSION}
ndenv rehash