YouTube Video
Step 1: Download Node.js Installer
Visit the Official Node.js Website:
Open your browser and go to https://nodejs.org/.Choose a Version:
- LTS (Long-Term Support): Recommended for most users, especially for production environments.
- Current: Includes the latest features but may not be as stable as the LTS version.
Download the Windows Installer:
Click the Windows Installer button for your chosen version. The file will be in.msi
format (e.g.,node-vxx.x.x-x64.msi
).
Step 2: Run the Node.js Installer
Locate the Installer:
Navigate to your Downloads folder and find the downloaded file (e.g.,node-vxx.x.x-x64.msi
).Launch the Installer:
Double-click the.msi
file to start the setup wizard.
Step 3: Install Node.js
Accept the License Agreement:
- Read the terms and click I Accept to proceed.
Choose an Installation Location:
- Use the default location (
C:\Program Files\nodejs
) or specify a custom path. - Click Next.
- Use the default location (
Select Components:
- Keep all the default components selected:
- Node.js runtime
- npm package manager
- Add to PATH (adds Node.js to your system's PATH environment variable).
- Click Next.
- Keep all the default components selected:
Install:
- Click Install to start the installation process.
Finish Setup:
- After the installation is completed, click Finish to close the installer.
Step 4: Verify the Installation
Open Command Prompt or PowerShell:
- Press
Win + R
, typecmd
orpowershell
, and press Enter.
- Press
Check Node.js Version:
- Run the following command:
node -v
- This displays the installed version of Node.js (e.g.,
v16.x.x
).
- Run the following command:
Check npm Version:
- Run the following command:
npm -v
- This displays the installed version of npm (Node Package Manager).
- Run the following command:
Step 5: Test Node.js
Create a Test Script:
- Open Notepad or any text editor.
- Write the following code:
console.log("Node.js is working!");
- Save the file as
test.js
in a folder of your choice.
Run the Script:
- Open Command Prompt or PowerShell and navigate to the folder containing
test.js
. - Run the script with the command:
node test.js
- You should see the output:
Node.js is working!
- Open Command Prompt or PowerShell and navigate to the folder containing
Optional: Update npm (if needed)
After installation, you might want to update npm to the latest version:
Run the following command:
npm install -g npm@latest
Verify the update:
npm -v
Conclusion
You’ve successfully installed Node.js and npm on Windows 11. With this setup, you’re ready to develop and run JavaScript applications on your system. Explore Node.js libraries, build APIs, or create full-stack applications using tools like React, Angular, or Vue. Happy coding!
Comments
Post a Comment
Leave Comment