Skip to content
>_VibeUnstuck

No matching version found

Last verified:

The fix

npm error notarget No matching version found for that package and version. The registry has the name and does not have that version. Depend on a version that exists, then update the lockfile.

  1. 1

    Read the package and the version in the notarget line

    The token after for is name@version or name@range. That is the spec that failed. Do not run npm install --force or --legacy-peer-deps. Those flags do not publish a missing version.

  2. 2

    Ask the registry what exists

    Run npm view <name> version for the current version, or npm view <name> versions --json when you need the list. Put a version from that list into package.json. If the view command 404s, the name is wrong. That is E404, not a version pin.

    npm view zod version
  3. 3

    Install so the lockfile matches

    From the app directory, run npm install after the version is real. Commit package.json and package-lock.json together. npm ci on Vercel will not invent the lock entry. Do not delete the lockfile to skip the check.

  4. 4

    If the bad spec comes from a dependency, do not edit node_modules

    When your package.json does not name that version and a dependency does, the notarget line is still the spec npm could not fetch. Upgrade or replace the dependency that asks for it. Do not vendor a fake tarball. A peer-dependency conflict after the version exists is the ERESOLVE page.

Why it happens

npm exits with ETARGET when the requested version does not exist on the registry. The line is npm error notarget No matching version found for left-pad@99.0.0. Older npm prints npm ERR! code ETARGET and the same notarget sentence. The following lines say that in most cases you or one of your dependencies are requesting a package version that doesn't exist.

Generated package.json files invent a version, or they pin a release that was never published. The package name can be real. npm ci then fails on Vercel before the app compiles. ERESOLVE is a different failure: the version exists and its peer dependencies do not line up. A lockfile that does not match package.json is the npm ci sync error, and it names Missing: or Invalid: rather than notarget. E404 is a name the registry does not have at all.

The next error you'll probably hit

Once this is fixed, the usual follow-up is npm error ERESOLVE unable to resolve dependency tree. npm error ERESOLVE unable to resolve dependency tree. Install a version whose peer matches this app. Do not start with --legacy-peer-deps.

Prompt to paste back into your AI tool

Paste this above the error.

npm failed with: npm error code ETARGET / No matching version found for <name@version>. The package.json range is <range>. We did not run npm view yet.

Do not use --force or --legacy-peer-deps. Do not delete the lockfile. Do not invent a version. Do not edit node_modules.

1. Run npm view <name> version, or versions --json if we need a specific release. If that 404s, the package name is wrong.
2. Set package.json to a version that view printed.
3. Run npm install and keep the lockfile diff. Do not change unrelated dependencies.
4. If our package.json does not request this spec, name the dependency that does. Do not patch it inside node_modules.

Common questions

+No matching version found, but the package is on npm. How?

The name exists and that version does not. npm view <name> version prints a real one. E404 would mean the name itself is missing. ERESOLVE would mean the version installed and the peers conflicted.

+Will deleting package-lock.json make ETARGET go away?

No. The registry still does not have the version package.json asks for. Fix the version, then install so the lockfile records a version that exists.

Related errors