From 06d5126ce9ab5066aacdb1355f16e2e27e3dc0a4 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:07:22 +0100 Subject: [PATCH] fix npm --- scripts/install | 3 +++ scripts/restore | 18 ++++++++++-------- scripts/upgrade | 17 ++++++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/scripts/install b/scripts/install index 9c7543d..2874064 100755 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,9 @@ ynh_script_progression --message="Installing dependencies..." --weight=10 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +# Upgrade NPM +ynh_npm install --global npm@latest + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/restore b/scripts/restore index 9098333..40778d5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,6 +10,16 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=10 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + +# Upgrade NPM +ynh_npm install --global npm@latest + #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -45,14 +55,6 @@ chown -R $app:www-data "$data_dir" #================================================= # SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=10 - -# Define and install dependencies -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version - #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7f9f63a..88768ad 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,6 +9,16 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=10 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + +# Upgrade NPM +ynh_npm install --global npm@latest + #================================================= # CHECK VERSION #================================================= @@ -68,13 +78,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=10 - -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version - #================================================= # SPECIFIC UPGRADE #=================================================