Reputation: 21
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.
Upvotes: 1
Views: 11138
Reputation: 3770
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.arch
then 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).
Upvotes: 11