en fait pas www-data node dans son folder

This commit is contained in:
Valentin 2024-02-26 16:26:11 +01:00
parent 77c655e412
commit ffb7cb6372
1 changed files with 10 additions and 8 deletions

View File

@ -192,17 +192,19 @@ 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