At first I had problems with running Node natively on my M1 machine. After installing NodeJS v15 through NVM I was able to compile my application for arm64(apple silicon) with no problem.
How could I switch back to installing NodeJs for Intel, so I can build my projects for both M1 and Intel on the same machine?
I tried reverting to a NodeJS version before v15, but that did not work when compiling.
Try:
- Before installing the older node version with nvm we need to change zsh to work in x64 arch.
arch -x86_64 zsh
- Checking
node -p process.archthen output x64 instead of arm64. means it able to run with rosetta 2.- After installing it, change zsh back to arm64
arch -arm64 zsh
- Rerun the lerna job and it's working normally. Each cpu monitored work averaging 40%, the temperature is normal (below 50 C), all job is marked as intel and the job done around 20 minutes (as expected).
From Notes on NodeJS in Apple M1 via NVM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With