jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.03k stars 210 forks source link

Can't install Node@14.17.3 with Apple M3 #2302

Closed arcaderob closed 1 week ago

arcaderob commented 2 weeks ago

Describe the bug I am trying to install and older version of Node (14.17.3) on a new MBP running am M3 chip. It is exiting with this error:

[node] Error 2
[ERROR] sh failed
Error:
   0: sh exited with non-zero status: exit code 2

Location:
   src/cmd.rs:406

Version:
   2024.5.16 macos-arm64 (8838098 2024-05-15)

To Reproduce run mise install node@14.17.3

Expected behavior It installs the version of Node

mise doctor output

version: 2024.5.16 macos-arm64 (8838098 2024-05-15)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Wed, 15 May 2024 04:31:10 +0000
  Rust Version: rustc 1.78.0 (9b00956e5 2024-04-29)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin23.0)

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/.config/mise/config.toml

backends:
  cargo
  go
  npm
  pipx
  ubi

plugins:
  bun     (core)
  deno    (core)
  erlang  (core)
  go      (core)
  java    (core)
  node    (core)
  python  (core)
  ruby    (core)

toolset:
  python@3.9.6
  node@20.10.0

env_vars:
  MISE_SHELL=zsh

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = false
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "/Users/rob.gill/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No warnings found
1 problem found:

1. new mise version 2024.6.4 available, currently on 2024.5.16

Additional context

% node -v
v20.10.0
% python --version
Python 3.9.6
jdx commented 2 weeks ago

it's node itself that does not support arm macs. You need to use rosetta.

arcaderob commented 2 weeks ago

@jdx - Thanks for the quick reply!

arcaderob commented 2 weeks ago

@jdx - I have opened iTerm2 with Rosetta enabled, but it is still showing warnings when trying to install that version of node. I have verified that Rosetta is installed and that the arch is i386

jaredallard commented 2 weeks ago

@jdx - I have opened iTerm2 with Rosetta enabled, but it is still showing warnings when trying to install that version of node. I have verified that Rosetta is installed and that the arch is i386

Try arch -x86_64 mise install node@14.17.3

arcaderob commented 2 weeks ago

Try arch -x86_64 mise install node@14.17.3

Still not working. I'm receiving:


% arch
i386
% arch -x86_64 mise install node@14.17.3
arch: posix_spawnp: mise: Bad CPU type in executable
roele commented 1 week ago

One thing you can do is download the archive from the website and extract it to ~/.local/share/mise/installs/node/14.17.3. Then clear the cache via mise cache clear and the version should show up in mise ls and work as expected (via Rosetta).

jdx commented 1 week ago

the docs explain how to use rosetta: https://mise.jdx.dev/tips-and-tricks.html#macos-rosetta