首页 > 解决方案 > 本地:-A:无效选项

问题描述

我无法在新的 macOS(M1 芯片)上安装带有asdf的 Node.js。我怎样才能解决这个问题?我的环境似乎很普通。

$ asdf install nodejs 14.15.4
/Users/stefan/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 35: local: -A: invalid option
local: usage: local name[=value] ...
/Users/stefan/.asdf/plugins/nodejs/bin/../lib/utils.sh: line 51: Fermium: unbound variable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3490    0  3490    0     0  37934      0 --:--:-- --:--:-- --:--:-- 37934
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10858    0 10858    0     0   106k      0 --:--:-- --:--:-- --:--:--  107k
Binary not found for version 14.15.4

版本

调试

utils.sh 第 35 行

  local -A aliases

utils.sh 的第 51 行

  if [ -z "${aliases[lts]:-}" ]; then
    printf "lts\t%s\n" "$version"
    aliases[lts]="$version"
  fi

标签: node.jsasdf-vm

解决方案


brew install bash

更多详情:https ://github.com/asdf-vm/asdf-nodejs/issues/199


推荐阅读