Skip to content

Commit 99f937c

Browse files
committed
Ädd tutorial for setting up Node.js
1 parent b4b3330 commit 99f937c

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

docs/NodeJS-Setup/index.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,45 @@ The installation process varies slightly by operating system. Follow the instruc
5454
### Step 3: Verify the Installation
5555
After installation, let's check if Node.js is working correctly:
5656
1. Open your terminal or command prompt.
57-
2. Type the following command and press Enter:
57+
2. Type the following command and press Enter:
58+
59+
node -v
60+
61+
- This should display the version of Node.js, e.g., `v18.12.1`.
62+
3. Next, check if npm (Node Package Manager) is installed:
63+
64+
npm -v
65+
66+
- This should show a version like `8.19.2`. npm is used to install packages and dependencies.
67+
68+
If you see the versions printed, congratulations—Node.js is set up successfully!
69+
70+
### Step 4: Set Up a Simple Project (Optional Hands-On)
71+
To make this more practical, let's create a simple "Hello World" project:
72+
1. In your terminal, create a new directory:
73+
74+
mkdir my-first-node-project cd my-first-node-project
75+
76+
2. Create a new file called `app.js` using your code editor:
77+
78+
echo 'console.log("Hello, Node.js!");' > app.js
79+
80+
3. Run the file with Node.js:
81+
82+
node app.js
83+
84+
4. You should see: `Hello, Node.js!` printed in the terminal.
85+
86+
## Troubleshooting Common Issues
87+
- **Error: 'node' is not recognized**: Ensure Node.js was added to your system's PATH during installation. Restart your terminal or computer and try again.
88+
- **Permission errors on macOS/Linux**: If you encounter issues, try running commands with `sudo`, but be cautious.
89+
- **Version mismatches**: If the versions don't match, double-check the installation or reinstall from the official site.
90+
91+
For more help, refer to the [official Node.js documentation](https://nodejs.org/en/docs/).
92+
93+
## Conclusion
94+
You've now set up a local development environment with Node.js! This is your first step toward building web applications, experimenting with frameworks like React, or contributing to projects like Recode Hive. Once you're comfortable, try creating a simple web server or exploring npm packages.
95+
96+
If you found this tutorial helpful, consider sharing your experience in the Recode Hive community. Happy coding! 🚀
97+
98+
---

0 commit comments

Comments
 (0)