-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Description
Hello friends! Running the easy-install script from the README on an x86_64 Mac will show that dvm installed successfully, but when you try to run the executable you'll get:
Bad CPU type in executable.
Did some poking around and found that the script does indeed detect the architecture correctly—and even selects the correct .zip file to download:
x86_64-apple-darwin
https://cdn.jsdelivr.net/gh/justjavac/dvm_releases@main/dvm-x86_64-apple-darwin.zip
However, after running 'file' on the downloaded + extracted file, it turns out the binary is compiled for ARM64, not x86_64:
$ file dvm
dvm: Mach-O 64-bit executable arm64
$ file $(which node)
node: Mach-O 64-bit executable x86_64
(working node binary for comparison)
This issue also affects 1.9 downloads on /releases
1.8 and below have no issue and run just fine
Fix
Binaries for x86_64 will have to be built correctly.
A quick and dirty fix is to run this (it installs dvm as normal then throws in the correct architecture (slightly out of date) executable):
curl -fsSL https://dvm.deno.dev | sh && \
dvm_dir="${DVM_DIR:-$HOME/.dvm}"; curl -sL https://github.com/justjavac/dvm/releases/download/v1.8.8/dvm-x86_64-apple-darwin.zip | bsdtar -xf- -C "$dvm_dir/bin/" && chmod +x "$dvm_dir/bin/dvm" && echo "dvm architecture fixed"
Metadata
Metadata
Assignees
Labels
No labels