Volta: Can't install node on M1

Created on 10 Mar 2021  Â·  2Comments  Â·  Source: volta-cli/volta

Unable to install Node with Volta on 2020 M1 MacBook Air on 11.2 (20D64). Steps to reproduce:

➜  ~ curl https://get.volta.sh | bash
➜  ~ volta install node@15
success: installed and set [email protected] (with [email protected]) as default
➜  ~ node -v
Volta error: Could not execute command.

See `volta help install` and `volta help pin` for info about making tools available.
Error details written to /Users/zack/.volta/log/volta-error-2021-03-10_17_15_17.387.log

Contents of /Users/zack/.volta/log/volta-error-2021-03-10_17_15_17.387.log:

"node" "-v"
Volta v1.0.2

Could not execute command.

See `volta help install` and `volta help pin` for info about making tools available.

Error cause: Bad CPU type in executable (os error 86)

And some more details:

➜  ~ volta which node
/Users/zack/.volta/tools/image/node/15.11.0/bin/node
➜  ~ /Users/zack/.volta/tools/image/node/15.11.0/bin/node --version
zsh: bad CPU type in executable: /Users/zack/.volta/tools/image/node/15.11.0/bin/node

Most helpful comment

Hi @zackkrida! Currently, there aren't any native builds of Node for M1 (see this issue for the status there: https://github.com/nodejs/node/issues/37309).

Volta uses the pre-built binaries (it doesn't support compiling from source), so in order to use Volta + Node on M1, you need to have Rosetta 2 enabled, which allows you to run the x64 binaries that Node provides.

Finally, even once Node starts creating native M1 builds, it is unlikely that they will create builds for all of the old versions, so some Node versions will likely always need to run through Rosetta.

All 2 comments

Hi @zackkrida! Currently, there aren't any native builds of Node for M1 (see this issue for the status there: https://github.com/nodejs/node/issues/37309).

Volta uses the pre-built binaries (it doesn't support compiling from source), so in order to use Volta + Node on M1, you need to have Rosetta 2 enabled, which allows you to run the x64 binaries that Node provides.

Finally, even once Node starts creating native M1 builds, it is unlikely that they will create builds for all of the old versions, so some Node versions will likely always need to run through Rosetta.

Got it, thanks! I was mistaken that there was a pre-built binary for @15.

Was this page helpful?
0 / 5 - 0 ratings