Skip to content

Instantly share code, notes, and snippets.

@LeZuse
Last active October 29, 2025 12:26
Show Gist options
  • Select an option

  • Save LeZuse/bf838718ff2689c5fc035c5a6825a11c to your computer and use it in GitHub Desktop.

Select an option

Save LeZuse/bf838718ff2689c5fc035c5a6825a11c to your computer and use it in GitHub Desktop.
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
# Run the install command from a native (ARM) terminal
# See https://github.com/nvm-sh/nvm#installing-and-updating
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
# Alternatively install using brew (officially unsupported by nvm):
# brew install nvm
# Don't forget to source the command in your shell profile to make it available in new terminals!
# From Rosetta Terminal (tick checkbox in Terminal right click menu -> Get Info -> Open using Rosetta)
# To verify you are running in Rosetta run:
arch
-> i386
# Install node
nvm install lts/fermium
# Verify node installation
nvm use lts/fermium
node -e 'console.log(process.arch)'
-> x64
# From native Terminal
# To verify you are running natively:
arch
-> arm64
# Install node
nvm install stable
# Verify node installation
nvm use stable
node -e 'console.log(process.arch)'
-> arm64
# To make DX a bit better you can alias your installations:
nvm alias arm stable
# arm -> stable (-> v15.6.0)
nvm alias intel lts/fermium
# intel -> lts/fermium (-> v14.15.4)
# To test aliases:
nvm use arm
# Now using node v15.6.0 (npm v7.4.0)
node -e 'console.log(process.arch)'
-> arm64
nvm use intel
# Now using node v14.15.4 (npm v6.14.10)
node -e 'console.log(process.arch)'
-> x64
@GoonerBrian
Copy link
Copy Markdown

GoonerBrian commented Feb 5, 2023

These instructions seem to have worked for me but I'm still not able to connect to an oracledb using my M1 Mac. I created this simple repo. If anyone is willing to take a look and tell me where I'm going wrong, I would really appreciate it.

Update: I was able to resolve the issue and will update the repo I linked in the next few days.

@Leakageonthelamp
Copy link
Copy Markdown

This super helpful and tricky thank a lot.

@sridharcriteria
Copy link
Copy Markdown

thanks a lot brother!

@Arunaks007
Copy link
Copy Markdown

@GoonerBrian Thanks a lot brother, I've been trying to fix this issue for the past 12hrs in my mac m1. Nothing really worked until i saw your repo. I really appreciate it❤️, its 3am here I can finally sleep now!!

@GoonerBrian
Copy link
Copy Markdown

@AmrMekkawy glad I could help! Sleep well.

@dipenparmar12
Copy link
Copy Markdown

Thank you, working expected.

@cbess
Copy link
Copy Markdown

cbess commented Dec 29, 2023

As a note, this is not needed if you are installing node 16+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment