Skip to content

Instantly share code, notes, and snippets.

@chooaya
Last active July 19, 2017 01:38
Show Gist options
  • Save chooaya/4e7f1ed1ee65fc50e3f821dae883cb0f to your computer and use it in GitHub Desktop.
Save chooaya/4e7f1ed1ee65fc50e3f821dae883cb0f to your computer and use it in GitHub Desktop.
#参考用リンク
# https://qualocus.wordpress.com/2014/04/19/how-i-installed-nvm-and-node-js-globally/
# http://multix.jp/install-nodejs/
#------------------rootではないユーザーでコマンドを実行----START--
#既存の node.js を削除します(もしあれば)
# sudo yum remove -y nodejs npm
sudo git clone https://github.com/creationix/nvm.git /opt/nvm-repo
# ^^^ this command clones the repo from github as root
sudo mkdir /opt/nvm
sudo chmod a+rx /opt/nvm
echo "export NVM_DIR=/opt/nvm" | sudo tee -a /root/.bash_profile
echo "source /opt/nvm-repo/nvm.sh" | sudo tee -a /root/.bash_profile
sudo su -
#------------------rootではないユーザーでコマンドを実行----END--
#------------------rootユーザーでコマンドを実行----START--
# ^^^ To use 'sudo su' or just 'sudo' instead of 'sudo su -' or 'sudo -i':
# source /root/.bash_profile in /root/.bash_profile
nvm ls-remote
# And then all of the following as root:
nvm install v8.0.0
ln -s /opt/nvm/versions/node/v8.0.0/bin/node /usr/local/bin/node
ln -s /opt/nvm/versions/node/v8.0.0/bin/node /usr/bin/node
ln -s /opt/nvm/versions/node/v8.0.0/bin/npm /usr/local/bin/npm
ln -s /opt/nvm/versions/node/v8.0.0/bin/npm /usr/bin/npm
# And likewise for any other packages you want to use
#------------------rootではないユーザーでコマンドを実行----END--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment