Корректировка nvm
This commit is contained in:
parent
a5bf6bac4c
commit
b05640fc00
@ -1,20 +1,28 @@
|
||||
#!/bin/bash
|
||||
. "../src/01-common.sh" || exit 5
|
||||
title "Installing nodejs..."
|
||||
echo
|
||||
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
|
||||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
|
||||
fi
|
||||
|
||||
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
|
||||
else
|
||||
nvm install-latest-npm
|
||||
fi
|
||||
|
||||
nvm install node
|
||||
nvm use node
|
||||
installed "node" && success "nodejs installed! $(nvm current)"
|
||||
installed "npm" && success "npm installed! $(nvm current)"
|
||||
installed "node" && nvm current
|
||||
nvm ls
|
||||
|
Loading…
Reference in New Issue
Block a user