asdf-nodejs: Broken pipe error

when running asdf install nodejs 14.15.4 I get this error:

/Users/lifeiscontent/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 62: printf: write error: Broken pipe

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 11
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Seems to be related to #189.

I used this as a workaround and it worked :

arch -x86_64 asdf install nodejs 14.15.5

@augustobmoura Upgrading bash removed the error for me.

➜  ~ bash --version
GNU bash, version 5.1.4(1)-release (aarch64-apple-darwin20.2.0)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
➜  ~ asdf install nodejs 15.12.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3835    0  3835    0     0  40368      0 --:--:-- --:--:-- --:--:-- 40368
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10860    0 10860    0     0   119k      0 --:--:-- --:--:-- --:--:--  117k
Binary not found for version 15.12.0

Oops, it looks like the latest version works. I was able to install 16.2.0.

@lifeiscontent can you send your bash version?

Also, @Debetux can you try to update your bash with brew and see if the error persists?

The default bash installation in macOS is severely outdated and we had other issues related to that in the past

I have the same issue on a new MacBook M1, using zsh & bash :

➜  ~ zsh --version
zsh 5.8 (arm-apple-darwin20.2.0)
➜  ~ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.
➜  ~ awk --version
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
Copyright (C) 1989, 1991-2020 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
➜  ~ sw_vers
ProductName:	macOS
ProductVersion:	11.2.3
BuildVersion:	20D91
➜  ~ asdf install nodejs 14.15.4
/Users/xxxx/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 62: printf: write error: Broken pipe
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3490    0  3490    0     0  37127      0 --:--:-- --:--:-- --:--:-- 37127
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10860    0 10860    0     0   123k      0 --:--:-- --:--:-- --:--:--  123k
Binary not found for version 14.15.4

I’ll try to dig a bit if I find some time.

seems to be an issue with filter_version_candidates or somewhere around that.

I’m using default zsh from latest osx (11.2.3)

zsh 5.8 (x86_64-apple-darwin20.0)

resolve_version_query() {
  local version_query="$1"

  local canon_version="$(
    # Find the first candidate which the alias match, then print it version
    print_index_tab |
      filter_version_candidates |
      awk -F'\t' -v "alias=$version_query" '$1 == alias { print $2; exit }'
  )"

  if [ -z "$canon_version" ]; then
    echo "$version_query"
  else
    echo "$canon_version"
  fi
}