Skip to content

Instantly share code, notes, and snippets.

@Rohithzr
Created February 19, 2019 09:46
Show Gist options
  • Save Rohithzr/cf7edaafa062ecd6d29588c397066784 to your computer and use it in GitHub Desktop.
Save Rohithzr/cf7edaafa062ecd6d29588c397066784 to your computer and use it in GitHub Desktop.
nvm as root
#!/bin/bash
sudo su
groupadd nvm
usermod -aG nvm $1
mkdir /opt/nvm
chown :nvm /opt/nvm
chmod -R g+ws /opt/nvm
git clone https://github.com/creationix/nvm.git /opt/nvm
cat <<EOT >> /etc/profile.d/nvm.sh
#!/bin/bash
export NVM_DIR="/opt/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
EOT
chmod +x /etc/profile.d/nvm.sh
# echo "#!/bin/bash" >> /etc/profile.d/nvm.sh
# echo "export NVM_DIR="/opt/nvm"" >> /etc/profile.d/nvm.sh
# echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> /etc/profile.d/nvm.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment