How to Install NodeJS

Node.js is an asynchronous JavaScript runtime environment that executes JavaScript code outside of a browser. This allows developers to code the back ends of their applications using JavaScript instead of another programming language. Node.js runs scripts on the server side to produce dynamic webpage content before the page is sent to the user's web browser.
Node.js has two versions. The LTS version is the most recent stable version that typically guarantees that critical bugs have been fixed or a period of time, often up to 30 months. Apps built for production or requiring a reliable Node.js version should always use LTS releases.
The Current version is the most recent release of Node.js. All new Node.js releases enter a current release period of six months. During this time, the content authors have time to identify major bugs and troubleshoot the build.
Since users of the current version may face incompatibility issues and bugs that are not yet addressed, it is important to download the tested and stable LTS version to make sure your app -- and Node.js -- perform as expected.
Install Node.js on Windows
Note: The LTS version for Node.js is currently 18.x.x. Due to the technology changes discussed below, please install version 16.x.x using the alternate instructions provided.
To install Node.js version 16on a Windows computer, go to Node's website. Under "Download for Windows (x64)", click the green box with the LTS version of Node to download the installer. Use this link and choose . The correct version will be labeled "x.x.x LTS Recommended for Most Users", where "x.x.x" is a combination of numbers. For example, the version shown in the following image is "12.14.1 LTS":
Important: Due to technologies constantly changing, Node's version 18 does not work well with MERN and GraphQL at this time. These problems are sure to be resolved in the upcoming weeks, but until then we'll roll back to Node version 16 to make sure our projects perform as they should. Use this Version Link to download version 16 on your machine until this issue is resolved.
After the installer has downloaded, open it to begin the installation process. Follow the prompts by clicking Next in the Setup Wizard, as shown in the following image:
Note: You may be prompted to install tools for native modules. Don't select anything on that page and just click on Next.
After you click the checkbox to accept the license agreement, continue clicking Next until the installation screen says "Ready to install Node.js". Click the Install button to finish installing Node.js.
When the installation is complete, click Finish.
Install Node.js on macOS
Note: The LTS version for Node.js is currently 18.x.x. Due to the technology changes discussed below, please install version 16.x.x using the alternate instructions provided.
To install Node.js on macOS, go to Node's website. Under "Download for macOS", click the green box with the LTS version of Node to download the installer. The correct version will be labeled "x.x.x LTS Recommended for Most Users", where "x.x.x" is a combination of numbers. For example, the version shown in the following image is "12.16.1 LTS":
After the installer has downloaded, open it to begin the installation process. Just as in the instructions for Windows, follow all of the installation prompts until Node.js is installed on your computer.
To use Homebrew to install Node.js, first go to Node's website to find the most recent LTE version.
Then, make sure to include the first two numbers of the LTS version in the installation script.
For example, in the image above, the version shown is "12.16.1 LTS". To install this version using Homebrew, you would use the following script: brew install node@12
.
Important: Due to technologies constantly changing, Node's version 18 does not work well with MERN and GraphQL at this time. These problems are sure to be resolved in the upcoming weeks, but until then we'll roll back to Node version 16 to make sure our projects perform as they should. For now, use this script until this issue is resolved: brew install node@16
.
After the installation is complete, enter node -v
in the terminal to check that the most recent LTS version has been installed.
Source: The Coding Boot Camp