Guide for Setting Up Visual Studio Code, Node.js, and GitHub Desktop
-
Download Visual Studio Code:
- Visit the official Visual Studio Code website.
- Download the version appropriate for your operating system (Windows, macOS, or Linux).
-
Install Visual Studio Code:
- Run the downloaded installer.
- Follow the installation prompts, making sure to:
- Check the box to add "Open with Code" to the context menu.
- Check the box to add Visual Studio Code to the system PATH.
-
Open Visual Studio Code:
- Launch Visual Studio Code.
- (Optional) Install recommended extensions for JavaScript and Node.js development, such as:
- ESLint
- Prettier - Code formatter
- Node.js Extension Pack
-
Download Node.js:
- Go to the official Node.js website.
- Download the LTS (Long-Term Support) version for better stability.
-
Install Node.js:
- Run the downloaded installer.
- Follow the prompts to install Node.js and ensure the option to install npm (Node Package Manager) is selected.
-
Verify Installation:
- Open a terminal (Command Prompt, PowerShell, or Terminal on macOS/Linux).
- Run the following commands to check if Node.js and npm are installed correctly:
node -v npm -v - You should see version numbers for both.
-
Sign Up for GitHub:
- Visit GitHub.
- Click Sign up in the top-right corner.
- Follow the prompts to create an account, providing an email address, username, and password.
-
Set Up Two-Factor Authentication (Optional but Recommended):
- Go to your profile picture > Settings > Security.
- Enable two-factor authentication for enhanced security.
-
Download GitHub Desktop:
- Go to the GitHub Desktop website.
- Download the installer for your operating system.
-
Install GitHub Desktop:
- Run the downloaded installer and follow the prompts.
-
Set Up GitHub Desktop:
- Launch GitHub Desktop.
- Sign in using your GitHub account credentials.
- Configure your name and email for commits:
- Go to File > Options (Windows) or GitHub Desktop > Preferences (macOS).
- Enter your name and email address (use the same email as your GitHub account).
-
Clone an Existing Repository:
- In GitHub Desktop, click File > Clone Repository.
- Select a repository from your GitHub account or paste the repository URL.
-
Create a New Repository:
- Click File > New Repository.
- Enter a name for the repository, choose a local path, and initialize it with a README file.
- Click Create Repository.
-
Push Changes to GitHub:
- Make changes to your local repository (e.g., add files).
- In GitHub Desktop, you’ll see the changes listed under Changes.
- Add a commit message and click Commit to main.
- Click Push origin to upload your changes to GitHub.
-
Create a Node.js Project:
- Open a terminal in Visual Studio Code.
- Run the following commands to create a simple Node.js project:
mkdir my-node-project cd my-node-project npm init -y - This creates a new project folder and initializes a
package.jsonfile.
-
Write a Sample Script:
- Create a new file in Visual Studio Code called
index.js. - Add the following code:
console.log('Hello, World!');
- Save the file.
- Create a new file in Visual Studio Code called
-
Run the Script:
- In the terminal, run:
node index.js - You should see
Hello, World!printed in the terminal.
- In the terminal, run:
-
Push Your Code to GitHub:
- Use GitHub Desktop to commit and push the new project folder to a repository.
Congratulations! You have set up Visual Studio Code, Node.js, and GitHub Desktop. You’re now ready to start coding and managing your projects effectively.
Get started learning to code here 🔥