Skip to content

Commit 90b8eca

Browse files
Prefer asdf when searching for an installed version of npm (#426)
* Prefer asdf-installed versions of npm * Remove trailing whitespace
1 parent e8d000b commit 90b8eca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shims/npm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ resolve_canon_npm() {
7878
# Try searching in current path (asdf core from 0.7 onwards adds all binaries candidates directories to PATH)
7979
# if that doesn't works (when calling the shim directly for example) it tries manually searching the binary in
8080
# the installed version provided by "asdf where"
81-
npm_location="${ASDF_NODEJS_CANON_NPM_PATH:-$(search_npm_on_current_path || manually_search_npm_bin)}"
81+
npm_location="${ASDF_NODEJS_CANON_NPM_PATH:-$(manually_search_npm_bin || search_npm_on_current_path)}"
8282

8383
if ! [ "$npm_location" ]; then
8484
printf "asdf-nodejs couldn't find a suitable npm executable\n"
@@ -128,7 +128,7 @@ manually_search_npm_bin() {
128128

129129
for bin_dir in "${bin_directories[@]}"; do
130130
if [ -x "$installed_dir/$bin_dir/npm" ]; then
131-
printf "%s\n" "$installed_dir/$bin_dir/npm"
131+
printf "%s\n" "$installed_dir/$bin_dir/npm"
132132
return 0
133133
fi
134134
done

0 commit comments

Comments
 (0)