Prepare for React debugging interviews with 30 questions on react-scripts errors, node_modules, PATH issues, Docker, and modern 2026 tooling.
React Scripts Command Not Found Interview: 30 Most Asked Questions (2026)
The `react-scripts: command not found` error shows up in phone screens, take-home follow-ups, and live debugging rounds. Interviewers use it to find out whether a React developer actually understands their toolchain — or just runs `npm start` and hopes for the best. The error itself is simple. What interviewers care about is whether you can explain why it happens, fix it systematically, and show awareness of the tooling landscape in 2026. This post covers all 30 questions you're likely to face, organized by experience level, with answers you can say out loud.
What is the react scripts: command not found error?
The one line explanation
`react-scripts` is a local dev dependency installed inside your project's `node_modules` folder — not a global binary on your system PATH. When you run `npm start`, npm looks for the `react-scripts` binary in `node_modules/.bin`. If `node_modules` is missing or incomplete, the shell can't find it and throws the error.
That's it. The binary isn't there. Everything else is about why it isn't there.
Where it shows up
- Fresh clone: You pulled a repo from GitHub, skipped `npm install`, and ran `npm start`. The `node_modules` directory is gitignored by default, so it doesn't come with the repo.
- Docker container: A volume mount overwrites the container's `node_modules` with an empty host directory.
- CI/CD pipeline: The install step failed silently or was skipped.
- Package manager mismatch: You ran `npm install` on a project that uses a `yarn.lock` file (or vice versa), corrupting the dependency tree.
- Monorepo setups: Hoisting moved `react-scripts` to a root `node_modules` that the project's start script can't resolve.
2026 tooling note
Create React App is in maintenance mode. Vite and Next.js are the default choices for new React projects. Interviewers know this. They still ask about `react-scripts` because large production codebases haven't migrated, and the debugging principles — dependency resolution, PATH mechanics, lockfile semantics — transfer directly to any Node.js toolchain.
Root causes — what interviewers expect you to know
- Missing `node_modules` after cloning. The directory is gitignored. If you don't run `npm install` or `yarn install` after cloning, there's no binary to find.
- Package manager mismatch. Running `npm install` on a Yarn managed project (or the reverse) can corrupt the dependency tree. Dan Abramov noted in a widely referenced Stack Overflow thread that `npm install` on a Yarn lockfile can break the install.
- Corrupt or partial install. An interrupted `npm install` — killed terminal, network drop, disk full — leaves `node_modules` in an incomplete state.
- Path issues on Windows. Spaces, ampersands, colons, or deeply nested folder names in the project path can prevent the shell from resolving `node_modules/.bin` correctly. The Windows specific error reads "is not recognized as an internal or external command, operable program, or batch file."
- Docker volume mounts overwriting `node_modules`. A bind mount maps the host directory (which has no `node_modules`) over the container's installed dependencies.
- Broken version string in `package.json`. A `react-scripts` version pinned to something like `^0.0.0` means npm can't resolve a valid package, and the install silently produces nothing useful.
React Scripts Command Not Found interview questions — fresher level
Fresher level questions test whether you understand the basics: what the error means, how npm resolves binaries, and what to do first. You don't need deep internals — you need clarity.
Q1: What does `react-scripts: command not found` mean? It means the shell tried to execute the `react-scripts` binary and couldn't find it. The binary lives in `node_modules/.bin`, which is where npm resolves locally installed package executables. If `node_modules` doesn't exist or the package wasn't installed, the command fails.
Q2: Why is `node_modules` not in the Git repository? Because it's listed in `.gitignore` by default. `node_modules` can contain thousands of files and hundreds of megabytes. Committing it would bloat the repo and create merge conflicts on every dependency update. Instead, the project stores a lockfile (`package-lock.json` or `yarn.lock`) that records exact versions, and each developer runs `npm install` to recreate `node_modules` locally.
Q3: What is the first command you run after cloning a React project? `npm install` (or `yarn install` if the project uses Yarn). This reads `package.json` and the lockfile, downloads all dependencies, and populates `node_modules`.
Q4: What does `node_modules/.bin` contain? Executable binaries for locally installed packages. When you install `react-scripts` as a dependency, npm creates a symlink (or cmd shim on Windows) in `node_modules/.bin/react-scripts` that points to the package's entry script.
Q5: What is the difference between a local and a global npm package? A local package is installed in the project's `node_modules` and is only available within that project's scripts. A global package is installed system wide (usually in a directory on your PATH) and is available from any terminal session. `react-scripts` should be local — it's a project dependency, not a system tool.
Q6: How do you verify that `react-scripts` is installed? Check whether `node_modules/.bin/react-scripts` exists. You can also run `npx react-scripts --version` or look at `package.json` to confirm it's listed under `dependencies` or `devDependencies`.
Q7: What does `npm start` actually do under the hood? It reads the `start` script from `package.json`. In a CRA project, that script is `react-scripts start`. npm resolves `react-scripts` from `node_modules/.bin`, then executes it. The script launches a Webpack dev server, compiles JSX and ES6+, and opens the app in a browser.
Q8: Can you install `react-scripts` globally? Should you? You can (`npm i -g react-scripts`), but you generally shouldn't. Global installation bypasses the project's pinned version, which can cause version mismatches across team members and CI environments. It's a last resort workaround, not a recommended fix.
Q9: What is `package-lock.json` and why does it matter here? It records the exact version of every dependency (and sub-dependency) installed in the project. Without it, `npm install` resolves versions from ranges in `package.json`, which can produce different `node_modules` trees on different machines. A missing or corrupted lockfile is a common reason for install failures.
Q10: How do you check which version of `react-scripts` is installed? Run `npx react-scripts --version` from the project root, or look at the `react-scripts` entry in `package.json`. You can also check `node_modules/react-scripts/package.json` directly for the installed version.
React Scripts Command Not Found interview questions — experienced level
These questions test debugging depth, environment awareness, toolchain decisions, and the ability to explain tradeoffs. Interviewers want to see how you think, not just what you know.
Q11: Walk me through how you'd debug this error from scratch on a new machine. First, confirm `node_modules` exists. If not, run `npm install`. If it does exist, check whether `node_modules/.bin/react-scripts` is present. If it's missing, the install was partial — delete `node_modules` and the lockfile, then reinstall. If the binary exists but the error persists, check the PATH and the project directory for special characters. On Windows, verify the shell can resolve the path. In Docker, check whether a volume mount is overwriting `node_modules`.
Q12: What happens when you mix `npm install` and `yarn install` in the same project? Each package manager writes its own lockfile (`package-lock.json` for npm, `yarn.lock` for Yarn) and structures `node_modules` differently. Running one manager on the other's lockfile can produce a corrupted dependency tree where some packages are missing or installed at wrong versions. The fix is to identify which lockfile the project uses and stick to that manager exclusively.
Q13: How does Docker's volume mount behavior cause this error, and how do you fix it? A common Docker Compose pattern mounts the host project directory into the container. If the host directory doesn't have `node_modules` (because you gitignored it), the mount overwrites the container's installed dependencies with an empty directory. Fix: add `node_modules` to `.dockerignore` and run `npm install` inside the container during the build step, or use an anonymous volume for `node_modules` so the mount doesn't overwrite it.
Q14: What are the risks of running `npm i -g react-scripts` as a fix? It installs a single version of `react-scripts` system wide, which may not match the version pinned in the project's `package.json`. This causes subtle build differences between your machine and CI or other developers' machines. It also masks the real problem — a broken local install — rather than fixing it.
Q15: How does PATH resolution work for locally installed npm binaries? When you run an npm script (like `npm start`), npm temporarily prepends `node_modules/.bin` to the shell's PATH. That's why `react-scripts start` works inside an npm script even though `react-scripts` isn't installed globally. If you try to run `react-scripts start` directly in your terminal (outside an npm script), it fails because `node_modules/.bin` isn't on your regular PATH.
Q16: What does deleting `package-lock.json` before reinstalling actually do? It forces npm to resolve all dependency versions from scratch using the ranges in `package.json`, rather than using the locked versions. This can fix a corrupted lockfile, but it also means you might get different dependency versions than the rest of your team. It's a reset, not a targeted fix — use it when you suspect the lockfile itself is the problem.
Q17: How would you reproduce this error intentionally in a CI environment? Skip the `npm install` step, or run `npm start` before install completes. You could also delete `node_modules/.bin/react-scripts` after install to simulate a partial install. This is useful for testing error handling in CI pipelines — making sure the pipeline fails clearly rather than silently.
Q18: What is Create React App's current maintenance status, and what does that mean for new projects? CRA is in maintenance mode as of 2026. It still works, but it's not receiving new features or major updates. The React team recommends frameworks like Next.js or bundlers like Vite for new projects. For existing CRA projects, `react-scripts` questions remain relevant because migration takes time and many production apps still depend on it.
Q19: How would you migrate a CRA project to Vite to avoid `react-scripts` issues entirely? At a high level: replace `react-scripts` with `vite` and `@vitejs/plugin-react` in `package.json`, create a `vite.config.js` file, update the `start`/`build`/`test` scripts, move `index.html` to the project root (Vite expects it there, not in `public/`), and update any environment variable prefixes from `REACT_APP_` to `VITE_`. Then delete `react-scripts` from dependencies entirely.
Q20: What is `npx react-scripts start` and when is it preferable to `npm start`? `npx` looks for the binary in `node_modules/.bin` first, then falls back to downloading it temporarily if it's not found. It's useful for one off execution or when you want to bypass the `scripts` section of `package.json`. In practice, `npm start` is preferred for project work because it uses the project's configured script, but `npx` is handy for debugging whether the binary is resolvable at all.
Q21: How do path characters (spaces, ampersands, colons) on Windows cause this error? Windows shells can misparse paths containing special characters. A project at `C:\My Projects\react-app` may cause the shell to split the path at the space. Ampersands and colons have special meaning in cmd.exe. The fix is to move the project to a path with no special characters, like `C:\projects\react-app`.
Q22: How do you handle this error in a monorepo where `react-scripts` is hoisted? In monorepos managed by tools like Lerna or npm workspaces, dependencies can be hoisted to the root `node_modules`. If the app's start script resolves `react-scripts` from its own `node_modules/.bin` (which is empty because the binary was hoisted), the command fails. Fix: either configure the workspace to not hoist `react-scripts`, or update the start script to reference the root binary path explicitly.
Q23: What does a broken `react-scripts` version string like `^0.0.0` in `package.json` indicate? It usually means someone manually edited `package.json` incorrectly, or a merge conflict corrupted the version field. npm can't resolve `react-scripts@^0.0.0` to any published version, so the install silently skips it. Fix: pin it to a known stable version like `5.0.1`.
Q24: How would you explain this error to a non-technical stakeholder? "The project depends on a tool called `react-scripts` to run. That tool gets downloaded when a developer sets up the project on their machine. On this machine, that setup step was either skipped or didn't finish correctly, so the tool isn't available. Running one command to reinstall it fixes the issue."
Q25: What tooling would you recommend for a new React project started in 2026? Vite for a single page app or a lightweight project — fast dev server, minimal config, active development. Next.js if you need server side rendering, routing, or API routes built in. CRA is still functional but not the right default for new work.
Q26: How do you prevent this error from recurring across a team? Document the setup steps in the README. Add a `postinstall` or `prepare` script if needed. Use a `.nvmrc` file to pin the Node version. Enforce a single package manager (add an `engines` field or use `only-allow` in a preinstall script). In CI, make the install step explicit and fail fast.
Q27: What's the difference between `dependencies` and `devDependencies` for `react-scripts`? CRA installs `react-scripts` under `dependencies`, not `devDependencies`. This is intentional — CRA's build and start scripts are needed in production like environments (like CI build steps), not just during local development. If someone moves it to `devDependencies` and the production install skips dev deps, the build breaks.
Q28: How would you debug this error if `node_modules` exists but the binary is still missing? Check whether `react-scripts` is actually listed in `package.json`. If it is, check `node_modules/react-scripts` — if the folder doesn't exist, the install failed for that specific package. Run `npm ls react-scripts` to see if npm can resolve it. If the folder exists but `node_modules/.bin/react-scripts` doesn't, the symlink creation failed — delete `node_modules` and reinstall.
Q29: Can this error occur with `yarn` even when `yarn.lock` is present? Yes. If `yarn.lock` references a version of `react-scripts` that's been unpublished or if the Yarn cache is corrupted, the install can complete without actually placing the binary. Running `yarn install --force` or clearing the cache with `yarn cache clean` and reinstalling usually resolves it.
Q30: What does this error tell you about a candidate's debugging approach in an interview? It tests whether someone starts from first principles (where does the binary live? is it installed? why not?) or jumps to Stack Overflow. Interviewers want to see a systematic process: verify the symptom, identify the root cause, apply the minimal fix, and explain why it works. The error is simple — the debugging methodology is what they're evaluating.
Quick fix reference — commands that actually work
This is the cheat sheet interviewers expect you to recite fluently.
- Standard fix: Run `npm install` (or `yarn install`) after cloning. This is the answer 90% of the time.
- Nuclear option: Delete `node_modules` and `package-lock.json` (or `yarn.lock`), then run `npm install` fresh. Use this when the dependency tree is corrupted.
- Package manager mismatch fix: Check which lockfile exists in the project. If `yarn.lock` is present, use `yarn install`. If `package-lock.json` is present, use `npm install`. Don't mix them.
- Docker fix: Add `node_modules` to `.dockerignore` and run the install step inside the container during the Docker build.
- Path fix (Windows): Move the project to a directory path with no spaces, ampersands, or special characters.
- Direct script fix: Update the `start` script in `package.json` to `./node_modules/.bin/react-scripts start` to bypass PATH resolution entirely.
- Version fix: Pin `react-scripts` to a known stable version (e.g., `5.0.1`) in `package.json` and reinstall.
How to practice answering these in a real interview
Knowing the fix is table stakes. Interviewers evaluate how you narrate your debugging process — whether you think out loud clearly, show environment awareness, and demonstrate that you understand why the fix works, not just what the fix is.
- Narrate your debugging process. State what you check first and why. "I'd start by confirming `node_modules` exists, because the error means the binary isn't where npm expects it" is a stronger opening than "I'd Google it."
- Show environment awareness. Mention the OS, the package manager, and whether you're in a container or CI pipeline — unprompted. This signals experience.
- Know the 2026 context. Acknowledge that CRA is in maintenance mode and name Vite or Next.js as the modern alternative. It shows you're current.
If you want to practice saying these answers out loud before the real thing, Verve AI's mock interview tool lets you run through scenario based debugging questions with real time feedback on your responses — the closest thing to a dry run without scheduling a friend.
The bottom line
The `react-scripts: command not found` error is simple to fix. Interviewers don't ask about it because the fix is hard — they ask because it reveals how well you understand dependency resolution, PATH mechanics, lockfile semantics, and the current state of React tooling. Candidates who can explain `node_modules/.bin` resolution, articulate why mixing package managers breaks things, and name a modern alternative to CRA stand out. Run through these 30 questions before your next interview. The debugging instinct you demonstrate matters more than the command you type.
Verve AI
Archive
