parcel-bundler/parcel · error · ThrowableDiagnostic
Could not find module "${name}" satisfying ${range}.
Error message
Could not find module "${name}" satisfying ${range}. What it means
Thrown by NodePackageManager.resolve() when a module is found but its version doesn't satisfy the requested range, AND getConflictingLocalDependencies finds conflicts in package.json. Unlike error [66] (module not installed at all), this means the module IS installed but at an incompatible version, and the conflict prevents auto-install from fixing it. The code reaches this branch only when conflicts!=null and the version check fails.
Source
Thrown at packages/core/package-manager/src/NodePackageManager.js:380
if (range != null) {
let pkg = resolved.pkg;
if (pkg == null || !semver.satisfies(pkg.version, range)) {
let conflicts = await getConflictingLocalDependencies(
this.fs,
name,
from,
this.projectRoot,
);
if (conflicts == null && options?.shouldAutoInstall === true) {
this.invalidate(id, from);
await this.install([{name, range}], from);
return this.resolve(id, from, {
...options,
shouldAutoInstall: false,
});
} else if (conflicts != null) {
throw new ThrowableDiagnostic({
diagnostic: {
message: md`Could not find module "${name}" satisfying ${range}.`,
origin: '@parcel/package-manager',
codeFrames: [
{
filePath: conflicts.filePath,
language: 'json',
code: conflicts.json,
codeHighlights: generateJSONCodeHighlights(
conflicts.json,
conflicts.fields.map(field => ({
key: `/${field}/${encodeJSONKeyComponent(name)}`,
type: 'key',
message: 'Found this conflicting local requirement.',
})),
),
},
],View on GitHub (pinned to 59484858a1)
Solutions
- Align version ranges in package.json so all dependencies requesting the same package use compatible semver ranges.
- Update the conflicting package to a version that supports the required dependency version.
- Use npm overrides / yarn resolutions / pnpm overrides to force a compatible version.
- Remove the lockfile and node_modules, then reinstall.
Example fix
// before: package.json conflicts
// "dependencies": { "pkg-a": "^1.0.0" } // needs lodash@^3
// "devDependencies": { "lodash": "^4.0.0" }
// after: align versions
// "dependencies": { "pkg-a": "^2.0.0" } // now supports lodash@^4
// "devDependencies": { "lodash": "^4.0.0" } Defensive patterns
Strategy: validation
Validate before calling
// Check version compatibility before resolving
const semver = require('semver');
async function checkVersionCompatibility(packageManager, name, range, from) {
try {
let {pkg} = await packageManager.resolve(name, from);
if (pkg && !semver.satisfies(pkg.version, range)) {
throw new Error(`${name}@${pkg.version} does not satisfy ${range}`);
}
} catch (e) {
// resolve itself may throw — handle separately
}
} Try / catch
try {
let resolved = await packageManager.resolve(id, from, {range});
} catch (e) {
if (e.diagnostics?.[0]?.message?.includes('satisfying')) {
// Version mismatch with local conflicts — align ranges in package.json
console.error('Align version ranges in package.json for:', id);
} else {
throw e;
}
} Prevention
- Keep all dependency version ranges consistent across package.json fields.
- Use `npm ls <package>` to inspect which versions are installed and why.
- When adding a new dependency, check its peerDependencies for version constraints.
- Run `npm outdated` regularly to identify version drift.
When it happens
Trigger: resolve() is called with a specific `range` option. The resolved package version doesn't satisfy that range. getConflictingLocalDependencies returns conflicts, meaning other entries in package.json constrain the version differently. The code checks `conflicts != null` and throws with a codeframe showing the conflicting package.json field.
Common situations: Package A requires lodash@^3 while package.json pins lodash@^4. A transitive dependency needs an older version of a shared lib. Lock file and package.json disagree after a failed or partial install. Manually editing package.json version ranges without reinstalling.
Related errors
- Could not install the peer dependency "${name}" for "${modul
- Could not find module "${name}", but it was listed in packag
- Could not resolve package "${name}" that satisfies ${range}.
- npmResolve failed: resolving ${name}@${version}
- ${name}@${version}: only npm semver dependencies are current
AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13).
Data as JSON: /api/errors/71698053f9247325.
Report an issue: GitHub.