fnm icon indicating copy to clipboard operation
fnm copied to clipboard

arch confused on fnm use/install

Open fantasywind opened this issue 3 years ago • 4 comments

The fnm will install node binary in home folder .fnm, for each version with its name. But in M1 Mac, x64 node binary also work perfectly with rosetta 2.

With some library (like node-oracledb) only support x64 arch node binary. I need switch x64 and arm64 in same node version.

For now: Node's binary arch based on installed --arch option or FNM_ARCH env, for example, my M1 mac install 18.2.0 in arm64 arch and 18.1.0 in x64 arch.

Screen Shot 2022-05-27 at 00 58 56

If I install 18.1 in arm64 arch with --arch, fnm install said the version is installed with correct arch message, but it's not work correctly.

Screen Shot 2022-05-27 at 01 03 54

Feature Request:

The fnm should install version to path with name including version and arch for arch switch 🥺

fnm install --arch x64 18.1
# Install to ~/.fnm/node-versions/x64/v18.1.0

fnm install --arch arm64 18.1
# Install to ~/.fnm/node-versions/arm64/v18.1.0

fantasywind avatar May 26 '22 17:05 fantasywind

Observed same behaviour with v14 and v16: Screenshot 2022-07-21 at 10 07 26 am

jurajpiar avatar Jul 21 '22 09:07 jurajpiar

@jurajpiar this is not confusion, we install a rosetta version because Node.js does not provide a prebuilt ARM binaries for Mac for 14.x: https://nodejs.org/dist/v14.20.0/

Schniz avatar Jul 21 '22 14:07 Schniz

for the original thread: I don't understand why people will use x64 and run through Rosetta when they can install an ARM version?

Schniz avatar Jul 21 '22 14:07 Schniz

Ah right so much for LTS

jurajpiar avatar Jul 22 '22 19:07 jurajpiar

I'm closing this as this is a known issue. Sorry that this is how it resolves @jurajpiar, hope that we won't have any issues like this in the future :pray:

Schniz avatar Aug 16 '22 13:08 Schniz