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 returning arm64
- Execute arch -x86_64 zsh
- Execute arch and confirm that it is now returning i386
- 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.
'Linux' 카테고리의 다른 글
macOS: 맥에서 SSH 키 생성하고 사용하기 (0) | 2023.08.13 |
---|---|
S3 CORS 헤더 관련 이슈 해결방법 (html2canvas, lottie) (0) | 2023.07.24 |
우분투 Node.js 설치및 npm 환경구축 (0) | 2023.06.26 |
[Docker] Ubuntu 22.04 Docker 설치 (0) | 2023.06.26 |
[Linux] nohup 사용법 (0) | 2023.06.26 |