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
Read the package and the version in the notarget line
The token after
forisname@versionorname@range. That is the spec that failed. Do not runnpm install --forceor--legacy-peer-deps. Those flags do not publish a missing version. - 2
Ask the registry what exists
Run
npm view <name> versionfor the current version, ornpm view <name> versions --jsonwhen you need the list. Put a version from that list intopackage.json. If the view command 404s, the name is wrong. That isE404, not a version pin.npm view zod version - 3
Install so the lockfile matches
From the app directory, run
npm installafter the version is real. Commitpackage.jsonandpackage-lock.jsontogether.npm cion Vercel will not invent the lock entry. Do not delete the lockfile to skip the check. - 4
If the bad spec comes from a dependency, do not edit node_modules
When your
package.jsondoes 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
- npm error ERESOLVE unable to resolve dependency treenpm error ERESOLVE unable to resolve dependency tree. Install a version whose peer matches this app. Do not start with --legacy-peer-deps.CursorLovableBoltNodeReactNov 4, 2026
- npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in syncnpm ci refused to install because package.json and the lockfile describe different dependencies. Update the lockfile on purpose and commit it. That pin is the safer install.CursorLovableBoltNodeNext.jsOct 22, 2026
- Module not found: Can't resolveModule not found: Can't resolve means the import path or package is not on disk, often after an AI edit. Fix the path or install the package, then restart.CursorLovableBoltTypeScriptNext.jsOct 14, 2026
- Treating warnings as errors because process.env.CI = trueThe Vercel build log says Create React App is failing on warnings because CI is true. A Next.js log that says Failed to compile with a type error is a different check.Cursorv0BoltVercelReactOct 27, 2026