install npm 2

This commit is contained in:
Valentin 2024-02-23 18:58:39 +01:00
parent 1a9f6b7e40
commit a30167280d
1 changed files with 6 additions and 8 deletions

View File

@ -170,14 +170,12 @@ fi
echo -e "${PURPLE}${BOLD}Install NPM ? (y/n) ${RESET}"
read answer
if [[ "$answer" == "y" ]]; then
if [ "$(whoami)" != "$username" ]; then
su - $username
fi
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v18
su - $username -c '\
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash &&\
export NVM_DIR="$HOME/.nvm" &&\
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&\
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" &&\
nvm install v18'
echo "ok pour npm";
fi