Create your own
Lesson illustration

Locating the Project Folder with the Backend Package.json

Hello again. Node.js and npm are now ready to run from a new PowerShell window. But npm install is project-specific: it reads instructions from a file named package.json. Until you have the actual project files and know where that file is, PowerShell cannot install or run the intended backend.

In this lesson, you will locate the project folder on Windows and verify the exact structure needed for the next steps: a project folder containing a backend folder, with package.json inside that backend folder. Plan for about 30–40 minutes, especially if you still need to download or extract the project.


First, make sure you have the project files

A backend is not installed by typing npm install in an empty terminal or in a random folder. The command reads the dependency list and scripts from the local project's package.json. Different projects can need completely different packages, so the project files must come first.

At the moment, no repository URL, ZIP file, or other project source has been provided. If someone gave you a ZIP file, a shared folder, or a GitHub repository link, use that exact source. Do not download an unrelated backend project merely because it contains a folder called backend.

If your project is on GitHub and you only need a local copy to run it, downloading a ZIP is the simplest approach. This is optional reading, only if you have a GitHub repository page for the project.

Downloading files from GitHub - GitHub Docs

Read GitHub Docs’ “Downloading files from GitHub” for the basic method of saving a repository as a ZIP file on your PC.

In the section “Downloading a repository’s files,” follow the download steps. On your real project’s GitHub page, use Code, then Download ZIP. The demonstration repository named in the article is only an example; do not download it unless it is actually your project.

After downloading a ZIP:

  1. Open File Explorer.
  2. Open Downloads.
  3. Find the downloaded ZIP, usually named something like project-name-main.zip.
  4. Right-click it and choose Extract All.
  5. Keep the default extraction location unless you have a reason to choose another one.
  6. Select Extract.

A ZIP file is compressed storage, not the working project folder. You need the extracted folder, often named something similar to project-name-main.

If you have no project link, ZIP, or shared project folder, pause here and obtain one from the person or place that supplied the backend instructions. You cannot reliably complete the remaining setup steps without it.


Recognize the folder structure you need

Open the extracted project folder in File Explorer. The names vary by project, but the pattern you are looking for is:

project-folder
│
├── backend
│   ├── package.json
│   ├── src
│   └── ...
│
└── possibly other files or folders

For example, your actual location might look like this:

C:\Users\YourName\Downloads\my-project-main\backend\package.json

The important part is not the project folder’s name. It is this evidence:

  • There is a folder named backend.
  • Opening backend reveals a file named package.json.

package.json is usually displayed as a JSON File in File Explorer. It may have a curly-braces icon, but icons differ between Windows installations. Focus on its exact filename.

Avoid a common mix-up: project root versus backend folder

A project may contain more than one package.json. For example, a project with a web interface and an API can have one for the frontend and one for the backend:

my-project
├── package.json
├── frontend
│   └── package.json
└── backend
    └── package.json

For this course, the target is specifically:

my-project\backend\package.json

Do not choose the parent project folder merely because it also has a package.json. Later, npm install and npm run dev must be run in the backend directory described by the project instructions.


Use PowerShell to inspect likely locations

File Explorer is often the easiest way to find a newly extracted project. PowerShell gives you a second, precise way to inspect folders and confirm file paths.

Open a new PowerShell window. The prompt normally begins at your user folder, similar to:

PS C:\Users\YourName>

Your Downloads folder is commonly available as:

$HOME\Downloads

Enter it and list its contents:

Set-Location "$HOME\Downloads"
Get-ChildItem

Set-Location changes your current folder. Get-ChildItem lists the files and subfolders there. dir and ls are also common shorter names for Get-ChildItem, but using the full command initially makes its purpose clear.

The Microsoft PowerShell documentation below shows how a normal folder listing displays both directories and files.

Get-ChildItem (Microsoft.PowerShell.Management)

Read the official Microsoft documentation’s first file-system example to understand how PowerShell lists a folder’s contents and how to distinguish folders from files.

In “Example 1: Get child items from a file system directory,” read the basic listing explanation, then inspect the command and its sample output immediately below it. Notice that entries whose Mode begins with d are directories, while the other entries shown are files.

Suppose Get-ChildItem shows:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----                ...                         my-project-main
-a----                ...                         my-project-main.zip

The folder my-project-main is the extracted project. The .zip file is only the downloaded archive. Inspect the extracted folder:

Get-ChildItem ".\my-project-main"

If backend appears in the list, inspect it too:

Get-ChildItem ".\my-project-main\backend"

You have found the correct backend location when this final listing contains package.json.

A PowerShell window runs `Get-ChildItem .\Foo -Recurse` and groups the output under directory headings. The same idea can reveal the folders nested inside an extracted project, although a targeted search for `package.json` is usually clearer.

Find package.json when you do not know the project folder name

If Downloads contains many folders, search for the file rather than opening every folder manually. From the Downloads folder, run:

Get-ChildItem -Path "$HOME\Downloads" -Filter package.json -File -Recurse -ErrorAction SilentlyContinue |
    Select-Object FullName

This command searches Downloads and its subfolders for files named exactly package.json, then prints their full locations. -Recurse means to look inside subfolders as well as the current folder. -ErrorAction SilentlyContinue merely hides access-denied messages from folders Windows will not let PowerShell inspect.

Example output:

FullName
--------
C:\Users\YourName\Downloads\my-project-main\backend\package.json

That line provides the answer you need. The backend directory is the path before \package.json:

C:\Users\YourName\Downloads\my-project-main\backend

A search may return several results. Choose the one that:

  1. Belongs to the project you intended to download.
  2. Has \backend\package.json at the end of the path.
  3. Is not inside an unrelated old project.

If you extracted the project to Desktop instead of Downloads, search there instead:

Get-ChildItem -Path "$HOME\Desktop" -Filter package.json -File -Recurse -ErrorAction SilentlyContinue |
    Select-Object FullName

Do not begin by recursively searching the entire C:\ drive. It can take a long time and return many irrelevant results. Start with Downloads, Desktop, or the exact folder where you chose to extract the project.


Record the target path without running npm yet

Once you find the target, copy or write down the full backend path. For example:

C:\Users\YourName\Downloads\my-project-main\backend

For now, the goal is only to identify that location and confirm its contents. Do not run npm install until you have entered this folder in PowerShell.

Use this completion checklist:

  • I have an extracted project folder, not just a .zip file.
  • I found a directory named backend.
  • Inside it, I found a file named package.json.
  • I know the complete path to that backend folder.
  • I have not yet run npm commands from a guessed or random location.

Key takeaways

npm install depends on the package.json belonging to the backend you want to run. First obtain and extract the project files, then identify the folder whose path ends in \backend and whose contents include package.json.

File Explorer can confirm the structure visually; PowerShell’s Get-ChildItem can list folders and search for package.json when the project is difficult to spot. In the next lesson, you will use the path you found to enter the backend directory in PowerShell and confirm that it is your current location.

Can't find a good explanation? Sign up and we'll make it for you

Sign up