From ffb7cb63726c81ac3c4136b0282203e5596c585c Mon Sep 17 00:00:00 2001 From: Valentin Date: Mon, 26 Feb 2024 16:26:11 +0100 Subject: [PATCH] en fait pas www-data node dans son folder --- install.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 4cf4653..37bf32f 100644 --- a/install.sh +++ b/install.sh @@ -192,18 +192,20 @@ read answer if [[ "$answer" == "y" ]]; then touch /var/www/.bashrc chown www-data:www-data /var/www/.bashrc - mkdir /var/www/node - chown www-data:www-data /var/www/node + mkdir /var/www/.nvm + chown www-data:www-data /var/www/.nvm + mkdir /var/www/.npm + chown www-data:www-data /var/www/.npm - su -s /bin/bash -c 'curl -o /var/www/node/install.sh https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash &&\ - export NVM_DIR="$HOME/node/.nvm" &&\ + su -s /bin/bash -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' www-data - ln -sf /var/www/node/.nvm/versions/node/v18.19.1/bin/node /usr/bin/node - ln -sf /var/www/node/.nvm/versions/node/v18.19.1/bin/npm /usr/bin/npm - ln -sf /var/www/node/.nvm/versions/node/v18.19.1/bin/npx /usr/bin/npx - + ln -sf /var/www/.nvm/versions/node/v18.19.1/bin/node /usr/bin/node + ln -sf /var/www/.nvm/versions/node/v18.19.1/bin/npm /usr/bin/npm + ln -sf /var/www/.nvm/versions/node/v18.19.1/bin/npx /usr/bin/npx + echo -e "${PURPLE}${BOLD}Node installed${RESET}"; fi