parcel-bundler/parcel · error · Error
Neither npm nor yarn found on system
Error message
Neither npm nor yarn found on system
What it means
Thrown by @parcel/create-react-app's install helper when usesYarn is null and neither yarn nor npm can be found on PATH (commandExists returns false for both). The helper needs at least one package manager to spawn the install process.
Source
Thrown at packages/utils/create-react-app/src/cli.js:140
let usesYarn;
async function installPackages(
packageExpressions: Array<string>,
opts: {|
cwd: string,
isDevDependency?: boolean,
|},
): Promise<void> {
log(
emoji.progress,
chalk`{dim Installing}`,
chalk.bold(...packageExpressions),
);
if (usesYarn == null) {
usesYarn = await commandExists('yarn');
if (!usesYarn && !(await commandExists('npm'))) {
throw new Error('Neither npm nor yarn found on system');
}
}
if (usesYarn) {
return promiseFromProcess(
spawn(
'yarn',
[
'add',
opts.isDevDependency ? '--dev' : null,
...packageExpressions,
].filter(Boolean),
{cwd: opts.cwd},
),
);
}
return promiseFromProcess(View on GitHub (pinned to 59484858a1)
Solutions
- Install Node.js (which ships npm): use nvm, fnm, or the official installer.
- Optionally install Yarn: `npm install -g yarn` or use Corepack.
- Verify with `which npm` / `which yarn` that the binary is on PATH.
- If in a container, extend the image to include node/npm.
Example fix
// before $ docker run --rm minimal-image create-react-app app // no npm/yarn // after $ apk add --no-cache nodejs npm # then re-run create-react-app
Defensive patterns
Strategy: validation
Validate before calling
const commandExists = require('command-exists');
async function ensurePackageManager() {
let usesYarn = false;
try { await commandExists('yarn'); usesYarn = true; } catch {}
if (!usesYarn) { try { await commandExists('npm'); } catch { throw new Error('Install Node.js (npm) or Yarn first.'); } }
return usesYarn;
} Prevention
- Install Node.js (bundles npm) before running the CLI.
- Verify `which npm && which yarn` succeeds in your environment.
- For containers, extend the base image with nodejs + npm.
When it happens
Trigger: commandExists('yarn') resolves false AND commandExists('npm') resolves false, before any package can be installed.
Common situations: Running the CLI in a minimal Docker container, a CI image without Node tooling, or a system where Node was installed without npm. Also when PATH is misconfigured so neither binary is discoverable.
Related errors
- File or directory at ${packagePath} already exists
- IDBCache is only supported in the browser
- Unknown environment feature: ${feature}
- Entry ${entry} does not exist
- NodeFS isn't available in the browser
AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13).
Data as JSON: /api/errors/653cfb3a0f1237c0.
Report an issue: GitHub.