Created
February 19, 2019 09:46
-
-
Save Rohithzr/cf7edaafa062ecd6d29588c397066784 to your computer and use it in GitHub Desktop.
nvm as root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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