From 63760680f811d5e71cc5868fe57c7cc9065f8227 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 28 Apr 2023 05:11:13 +0000 Subject: [PATCH] Upgrade n to v --- helpers/vendor/n/n | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/helpers/vendor/n/n b/helpers/vendor/n/n index 2739e2d00..2a877c45b 100755 --- a/helpers/vendor/n/n +++ b/helpers/vendor/n/n @@ -61,7 +61,7 @@ function n_grep() { # Setup and state # -VERSION="v9.0.1" +VERSION="v9.1.0" N_PREFIX="${N_PREFIX-/usr/local}" N_PREFIX=${N_PREFIX%/} @@ -1484,6 +1484,20 @@ function show_diagnostics() { fi fi + # Check npm too. Simpler check than for PATH and node, more like the runtime logging for active/installed node. + if [[ -z "${N_PRESERVE_NPM}" ]]; then + printf "\nChecking npm install destination...\n" + local installed_npm="${N_PREFIX}/bin/npm" + local active_npm="$(command -v npm)" + if [[ -e "${active_npm}" && -e "${installed_npm}" && "${active_npm}" != "${installed_npm}" ]]; then + echo_red "There is an active version of npm shadowing the version installed by n. Check order of entries in PATH." + log "installed" "${installed_npm}" + log "active" "${active_npm}" + else + printf "good\n" + fi + fi + printf "\nChecking permissions for cache folder...\n" # Most likely problem is ownership rather than than permissions as such. local cache_root="${N_PREFIX}/n"