Корректировка nvm

This commit is contained in:
Anthony Axenov 2022-01-08 14:40:30 +08:00
parent a5bf6bac4c
commit b05640fc00
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC

View File

@ -1,20 +1,28 @@
#!/bin/bash #!/bin/bash
. "../src/01-common.sh" || exit 5 echo
title "Installing nodejs..." echo "==============================================="
echo "Installing nodejs..."
echo "==============================================="
echo
# apti nodejs npm installed() {
command -v "$1" >/dev/null 2>&1
}
# sudo apt install -y --autoremove nodejs npm
if !installed "nvm"; then if !installed "nvm"; then
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
fi fi
if [ $(nvm current) == 'system' ]; then if [ $(nvm current) == 'system' ]; then
warning "You already have node installed - removing to install actual version" echo "WARNING: You already have node installed - removing to install actual version"
sudo apt remove -y --autoremove nodejs npm sudo apt remove -y --autoremove nodejs npm
else else
nvm install-latest-npm nvm install-latest-npm
fi fi
nvm install node nvm install node
nvm use node nvm use node
installed "node" && success "nodejs installed! $(nvm current)" installed "node" && nvm current
installed "npm" && success "npm installed! $(nvm current)"
nvm ls nvm ls