Skip to main content

🔧 Troubleshooting Guide

Stuck on a setup issue? You're not alone. This page covers the most common environment problems beginners run into — and how to fix them.

📑 Jump To

🌐 General Issues

"command not found" or "is not recognized"

What it means: Your terminal can't find the program you're trying to run. The program either isn't installed, or it's not on your system PATH.

What to check:

  • Did you install the software? Go back to Lesson 1.2 and run through the steps.
  • Did you restart your terminal after installing? Many installers modify the PATH, but existing terminal sessions don't see the change.
  • On Windows, did you check "Add to PATH" during installation? If not, uninstall and reinstall with that option selected.

How to check your PATH

# In PowerShell or Command Prompt:
echo %PATH%

# Or in PowerShell:
$env:PATH -split ";"
// In Terminal:
// echo $PATH
// Or see it split by colons:
// echo $PATH | tr ':' '\n'
// In Terminal:
// echo $PATH
// Or see it split by colons:
// echo $PATH | tr ':' '\n'

"Permission denied" errors

What it means: Your user account doesn't have permission to read, write, or execute a file or folder.

Fixes:

  • Windows: Run your terminal as Administrator (right-click → "Run as administrator").
  • macOS / Linux: Prefix the command with sudo (e.g., sudo npm install -g ...). Use sparingly — only for global installs.
  • Make sure you're working inside a folder you own, like your home directory or Desktop, not a system folder.

Wrong version installed

What it means: You have an older version of a tool that doesn't support features used in this course.

How to check versions:

# Need 3.10 or higher
python --version
# or on some systems:
python3 --version
// Need Node.js 18 or higher
// node --version
// npm --version
// Need .NET SDK 8 or higher
// dotnet --version
// dotnet --list-sdks

Fix: Download and install the latest version from the official site. The new install will usually replace the old one automatically.

Multiple versions conflicting

Symptoms: Commands run a different version than expected, or libraries installed for one version aren't available in another.

Common scenario: You have both python (pointing to Python 2) and python3 (pointing to Python 3) on your system.

Fixes:

  • Always use python3 and pip3 on macOS/Linux to be explicit.
  • On Windows, use the Python Launcher: py -3 script.py.
  • For Node.js, consider using nvm (Node Version Manager) to switch between versions.
  • For .NET, use dotnet --list-sdks to see all installed versions, and set the version in a global.json file if needed.

🐍 Python Issues

"python" opens the Microsoft Store (Windows)

What's happening: Windows 10/11 ships with a stub python.exe that redirects to the Microsoft Store instead of running Python.

Fix:

  • Open Settings → Apps → Advanced app settings → App execution aliases.
  • Turn off the two entries for python.exe and python3.exe.
  • Make sure Python is installed from python.org with "Add to PATH" checked.

"ModuleNotFoundError: No module named ..."

What it means: Python can't find a library you're trying to import.

Fixes:

  • Install the module: pip install module_name (or pip3 install module_name).
  • Make sure you're using the same Python that pip is linked to: python -m pip install module_name.
  • If you're inside a virtual environment, make sure it's activated.

IndentationError / TabError

What it means: Python uses indentation to define code blocks, and your spacing is inconsistent.

Fixes:

  • In VS Code, set "Insert Spaces" to true and "Tab Size" to 4 (the Python standard).
  • Turn on "Render Whitespace" in VS Code to see spaces vs. tabs.
  • Never mix tabs and spaces in the same file.

SyntaxError: invalid syntax (unexpected token)

Common causes:

  • Missing colon at the end of if, for, while, def, or class lines.
  • Using curly braces { } instead of indentation (mixing up with JS or C#).
  • Using && or || instead of Python's and / or.
  • Forgetting parentheses around print() (Python 2 habit).

⚡ JavaScript / Node.js Issues

"ReferenceError: require is not defined" (ES Modules)

What's happening: You're using import/export syntax (ES Modules) but Node.js defaults to CommonJS (require).

Fix: Add "type": "module" to your package.json, or name your file with a .mjs extension.

"SyntaxError: Cannot use import statement outside a module"

Same root cause as above. Node.js doesn't recognize import without being told to use ES Modules.

Quick fix: Run with node --experimental-modules file.js on older Node versions, or add "type": "module" to package.json.

npm EACCES permission error (macOS/Linux)

What's happening: npm is trying to install global packages in a system-owned directory.

Fix (recommended): Change npm's default directory to a user-owned folder:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Add to your shell profile (~/.bashrc or ~/.zshrc):
export PATH=~/.npm-global/bin:$PATH

Then restart your terminal.

"TypeError: fetch is not a function" (older Node.js)

What's happening: The built-in fetch API was added in Node.js 18. Older versions don't have it.

Fix: Upgrade to Node.js 18+ (recommended for this course), or install the node-fetch package as a workaround.

Unexpected token / missing semicolons

Common in this course: If you're switching between Python and JavaScript, you might forget semicolons (optional but recommended in JS) or accidentally use Python syntax like elif instead of else if.

Tip: Install the ESLint extension in VS Code — it will underline syntax issues in real time.

🔷 C# / .NET Issues

"dotnet: command not found"

Fix: Install the .NET SDK (not just the Runtime). After installing, restart your terminal. On Linux, you may need to add ~/.dotnet to your PATH manually.

Top-level statements vs. traditional Main method

What's happening: Starting with .NET 6, C# supports "top-level statements" — you can write code directly in Program.cs without a class and Main() method. This course uses that style.

If you see errors about missing Main:

  • Make sure you're on .NET 6 or later (dotnet --version).
  • Your project file (.csproj) should target net8.0 or higher.
  • Only one file in the project can use top-level statements.

"CS0246: The type or namespace name could not be found"

What it means: You're referencing a type that C# doesn't know about — usually a missing using directive or NuGet package.

Fixes:

  • Add the correct using statement at the top of your file (e.g., using System.Text.Json;).
  • If it's a third-party library, install the NuGet package: dotnet add package PackageName.
  • VS Code's C# Dev Kit can auto-suggest missing usings — look for the lightbulb icon.

"error NETSDK1045: The current .NET SDK does not support targeting"

What's happening: The project targets a newer .NET version than what you have installed.

Fix: Either install the required SDK version, or change the TargetFramework in your .csproj file to match your installed version.

Build succeeded but nothing happens

Common cause: You're running dotnet build instead of dotnet run. Build only compiles; run both compiles and executes.

Also check: Make sure you're in the correct project folder (the one containing the .csproj file).

💻 VS Code Issues

Extensions not working or not suggesting completions

Fixes:

  • Make sure you have the recommended extensions: Python (Microsoft), C# Dev Kit (Microsoft), and ESLint.
  • Reload VS Code: press Ctrl+Shift+P → "Developer: Reload Window".
  • For Python, make sure the correct interpreter is selected: Ctrl+Shift+P → "Python: Select Interpreter".

Terminal in VS Code uses wrong shell

Fix: Open Settings → search for "Terminal Default Profile" → set it to your preferred shell (PowerShell on Windows, bash or zsh on macOS/Linux).

File encoding issues (weird characters in output)

What's happening: Your file might be saved in a different encoding than expected.

Fix: Click the encoding indicator in VS Code's bottom-right status bar → "Reopen with Encoding" → choose UTF-8. Then "Save with Encoding" → UTF-8.

🆘 Still Stuck?

If none of the above solved your problem, here's what to do next:

  1. Read the error message carefully. The last line of an error traceback usually tells you exactly what went wrong.
  2. Copy the error message and search for it. Paste it into Google or Stack Overflow — chances are someone has had the same issue.
  3. Check official documentation:
  4. Ask for help. Visit the contact page and describe what you tried and what error you're seeing.
🎓 Instructor Note: Using Errors as Teaching Moments

When students encounter these issues in class, resist the urge to just fix it for them. Walk them through the diagnostic process: reading the error, identifying the key phrase, and searching for a solution. This builds the troubleshooting muscle that separates beginners from competent developers.