From 1a9f6b7e409686ef93f964b9a9f7080162d9bed2 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 23 Feb 2024 18:52:40 +0100 Subject: [PATCH] install npm --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index d9c0244..cd07228 100644 --- a/install.sh +++ b/install.sh @@ -170,7 +170,15 @@ fi echo -e "${PURPLE}${BOLD}Install NPM ? (y/n) ${RESET}" read answer if [[ "$answer" == "y" ]]; then - echo "youhou"; + 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 + echo "ok pour npm"; fi