Using NodeJs 14 with Mac Silicon (M1)
Table of contents
I have recently received a new MacBook Pro with the Mac Silicon chip. However, I noticed that I am unable to compile NodeJs Version 14 which I have to use due to some of my projects are still on Angular 11 and 12.
Unfortunately, there is no NodeJs 14 that is built for ARM64; Hence it has no support for the new Mac Silicon which is built around ARM64.
Fortunately, there is some workaround to get NodeJs 14 to work with Mac Silicon. Apple provides Rosetta, a translation app that allows applications that are built for Intel Chip (or previous generation Mac) to run under Apple Silicon.
Installing Rosetta
To install Rosetta, you need to:
Open your terminal
Paste and execute
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
And that's it!
Installing NodeJs 14
For any Node installation in Mac, I recommend you to use NVM. It allows you to easily swap between Node versions through CLI.
To install NVM:
Open your terminal
Paste and execute
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Restart your terminal
You can confirm that NVM has been successfully installed by executing nvm
command in your terminal.
Now, to get to the real deal on installing NodeJs 14, we will execute everything through terminal.
Open your terminal
Execute
arch
and confirm that at the moment it is returningarm64
Execute
arch -x86_64 zsh
Execute
arch
and confirm that it is now returningi386
Execute
nvm install 14
. NVM will install the latest NodeJs 14.Execute
nvm use 14
to switch to NodeJs 14, if you have other NodeJs versions installed.
That's it, folks! You now are able to use NodeJs 14 with your new Mac.
Subscribe to my newsletter
Read articles from Gabriel George directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by