I have installed nvm using brew. After that, I installed node version of 16 through nvm and check the current version using node -v to see whether the node is working properly. However, when I install version 14 or any other previous versions and runs node -v, it gives this "zsh: bad CPU type in executable: node" message and I have no idea what to do about this, though, installing node v17 and running node -v works as expected. Below are the snippet of the said commands.
Asked
Active
Viewed 4.6k times
1 Answers
122
This is CPU related issue. It seems that your MacBook Air's CPU is Apple Silicon (M1).
You need update node version architecture on NVM.
softwareupdate --install-rosetta
Further details can be founded on NVM doc, "Macs with M1 chip" section.

Mirjalol Bahodirov
- 2,053
- 1
- 11
- 16
-
4As of 16.0 Node supports M1 without any special setup. https://github.com/nvm-sh/nvm#macos-troubleshooting – Freewalker May 24 '22 at 19:34
-
1this works for installing node 12 on my Mac m1 chip – Matteus Barbosa Jun 15 '22 at 20:05
-
4This also saved my life. Have been stuck for days working on setting up a new Mac M2 chip. Wish I had done this days ago. Thanks! – AndrewLeonardi Aug 11 '22 at 14:34
-
All of a sudden this is not working for me. Anyone have any updates? – AndrewLeonardi Jan 04 '23 at 17:34
-
1@AndrewLeonardi this happened to me this week and when staring out with `arch -x86_64 zsh` i got the Bad CPU type error - but when prefixing my nvm install command (actually asdf) directly it worked. Maybe due to using a homebrew-installed zsh in my case? – erikdstock Jan 11 '23 at 13:23
-
Thanks @erikdstock! Starting with arch -x86_64 zsh was the trick for me. The comment on this page from williamli (Nov 26) helped me out a lot https://github.com/nvm-sh/nvm/issues/2350 – AndrewLeonardi Jan 11 '23 at 15:35
-
Supporting the M1 without special setups is all well and good - but surely they could've been a smidgen more descriptive. That being said - it kind of feels like an obvious issue after-the-fact – KoalaZub Feb 10 '23 at 07:11
-
Temporarily moved from M1 to Intel and now most of CLI tools return this error... I managed to reinstall brew and node, but npm still returns this error Didn't find any info about migration TO intel yet – maximkrouk Jun 02 '23 at 00:54