Корректировка nvm
This commit is contained in:
parent
a5bf6bac4c
commit
b05640fc00
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user