From 3c8d64f307436478888f5da95171029913608104 Mon Sep 17 00:00:00 2001 From: nicofrand Date: Sat, 9 May 2020 13:04:36 +0200 Subject: [PATCH] Use npm in nodejs path instead of global npm --- manifest.json | 2 +- scripts/install | 4 +++- scripts/upgrade | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 27d1c56..66a647a 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "requirements": { "yunohost": ">= 3.6.0" }, - "version": "0.16.0~ynh3", + "version": "0.16.0~ynh4", "multi_instance": true, "services": [ "nginx" diff --git a/scripts/install b/scripts/install index c8feed7..55cd59e 100644 --- a/scripts/install +++ b/scripts/install @@ -140,7 +140,9 @@ ynh_use_nodejs ( cd "$final_path" chown -R "$app": "$final_path" - npm install --production --unsafe-perm + + # ynh_npm only exists for YunoHost 3.8+ + "$nodejs_path/npm" install --production --unsafe-perm ) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index fc97b56..4f65e4a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -156,7 +156,8 @@ ynh_use_nodejs # linked to modules compiled for the previous version. ynh_secure_remove --file="$final_path/node_modules" - npm install --production --unsafe-perm + # ynh_npm only exists for YunoHost 3.8+ + "$nodejs_path/npm" install --production --unsafe-perm ) #=================================================