Installing Node.js
Node.js is required for Angular development because Angular CLI and npm depend on the Node.js environment.
What is Node.js?
Node.js is a JavaScript runtime environment that allows JavaScript applications and development tools to run outside the browser.
Angular uses Node.js as part of its development environment. Angular CLI and npm work with Node.js to create, manage, develop and build Angular applications.
Node.js Installation Flow
Download
Download Node.js installer.
Install
Run the Node.js installer.
Verify
Check Node.js and npm.
Step 1: Download Node.js
Download the Node.js installer suitable for your operating system.
Important
Choose a Node.js version that is compatible with the Angular version used in your project.
Step 2: Run the Node.js Installer
Open the Installer
Double-click the downloaded Node.js installer.
Accept the License
Read and accept the Node.js license agreement.
Select Installation Location
Select the installation location or keep the default location.
Start Installation
Click the Install button and wait for the installation to complete.
Finish Installation
Click Finish after the installation is completed.
Step 3: Verify Node.js Installation
Open Command Prompt or Terminal and execute the following command:
node --version
Expected Output
The terminal displays the installed Node.js version.
Step 4: Verify npm Installation
npm is normally installed along with Node.js. Verify npm using the following command:
npm --version
Expected Output
The terminal displays the installed npm version.
Node.js and npm Verification
Node.js
Node.js is installed and available from the terminal.
npm
npm is available for installing and managing project packages.
Node.js Role in Angular
Common Installation Issue
'node' is not recognized
If the terminal says that the node command is not recognized, close the terminal and open it again.
Then run node --version again.
Summary
Node.js is an important prerequisite for Angular development.
After installing Node.js, verify both Node.js and npm from the terminal.
Once Node.js is installed successfully, the next step is Installing Angular CLI.