Appendix B Installing Node.js on macOS and Windows
In chapter 2, we create a Node.js web application. This application will be transformed throughout the book to be deployed to Kubernetes.
Before we can start building our application, we need to install Node.js on our machine. This appendix will help us do that on macOS and Windows. In chapter 3, we cover how to install Node.js on Linux. For my most up-to-date guide on installing Node.js, please consider visiting my blog at https://cfe.sh/blog/. If you are interested in the official documentation for installing Node.js, visit https://nodejs.org/.
For this book, we just want to make sure we’re using the latest long-term support (LTS) version of Node.js. The easiest way to download is by going to https://nodejs.org and running through the default installation process. The rest of this appendix will help you install Node.js on macOS and Windows.
B.1 Node.js Installation for macOS
I recommend installing Node.js in one of two ways:
- Directly from Nodejs.org
- Using the Node Version Manager (nvm; https://github.com/nvm-sh/nvm)
There are other tools that can install Node.js, but it often makes it more difficult in the long run than the previous two options.
Unlike Python, we do not need to know which processor our Apple computer is running since the latest LTS version of Node.js already supports Apple Silicon (M1, M2, etc.) and Intel processors.
To install nvm, use the following command: