Skip to content

Instantly share code, notes, and snippets.

@hzoo
Last active December 14, 2024 22:20
Show Gist options
  • Select an option

  • Save hzoo/df94af2d2ec48696e683b772c775aa67 to your computer and use it in GitHub Desktop.

Select an option

Save hzoo/df94af2d2ec48696e683b772c775aa67 to your computer and use it in GitHub Desktop.
`No matching version found for` babel

You might of seen something like:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/types@^7.9.6.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget

similar issues here

Check if the package for which npm throws an error is published by searching on the npm website.

For example: @babel/types

image

Here you can validate that the version on the website is up to date. If it's there, then it was correctly published on our end, but for some reason your package manager client doesn't find it, likely due to using a proxy. In this case, we won't be able to do anything on our end.

Proxies

This seems to happen right after a publish, as the cache's need to update.

If you are using a proxy (Nexus) for the npm registry (maybe it's used by your company, or you are using it because your country blocks the main npm registry), then it's likely that it has cached the old version of the package and it isn't loading the new one. If you can, try clearing the proxy's cache. Otherwise, you will have to wait until the cache is automatically updated (it might take a few hours, or even days).

If you are not using a proxy, or if it isn't a caching problem, please report the issue to npm instead of the Babel repo!

@nicolo-ribaudo

Copy link
Copy Markdown

Of which package? We only publish packages which have changed since the previous version.

@Radiant-O

Copy link
Copy Markdown

@babel/parser@^7.18.5.

@nicolo-ribaudo

nicolo-ribaudo commented Jun 22, 2022

Copy link
Copy Markdown

@Radiant-O

Radiant-O commented Jun 22, 2022

Copy link
Copy Markdown

https://www.npmjs.com/package/@babel/parser is already published
babel

I'm getting this error
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/parser@^7.18.5.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

pls what is the solution?, the package is already published, I just checked.

@Radiant-O

Copy link
Copy Markdown

Where can I report the bug?, Link?

@nicolo-ribaudo

Copy link
Copy Markdown

Is there a proxy between you and the npm registry? (for example a company proxy, a verdaccio instance, or something like cnpmjs.org)
Yes -> It's a problem with that proxy, its cache needs to be updated
No -> It might be a bug with the npm registry

@GitSkelly

Copy link
Copy Markdown

I am getting the same error as @Radiant-O, except with @babel/helper-environment-visitor@^7.18.6. Any updates on how to fix this?

@Radiant-O

Copy link
Copy Markdown

uninstall the whole cli and re-install, it should work,
P.S You can try re installing your node, don't download the latest version, the previous should work.

@KhangVo1204

KhangVo1204 commented Sep 6, 2022

Copy link
Copy Markdown

today I got error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/helper-plugin-utils@^7.19.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

what is the solution?

@RavimDhinesh

Copy link
Copy Markdown

I am also getting the same error as KhangVo1204 mentioned. Kindly provide with the solution

@bobjeronowitz-gs1us

Copy link
Copy Markdown

I am getting the same error now for version 7.19.1

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/parser@^7.19.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

what is the solution?

@andieromero

Copy link
Copy Markdown

Hello, I am now getting it for 7.19.3

7820 error notarget No matching version found for @babel/generator@^7.19.3.
7821 error notarget In most cases you or one of your dependencies are requesting
7821 error notarget a package version that doesn't exist.

@apelluru

apelluru commented Sep 30, 2022

Copy link
Copy Markdown

Hey, I am also getting similar error:

[INFO] npm ERR! code ETARGET
[INFO] npm ERR! notarget No matching version found for babel-plugin-transform-react-jsx@^7.19.0.
[INFO] npm ERR! notarget In most cases you or one of your dependencies are requesting
[INFO] npm ERR! notarget a package version that doesn't exist.

from logs:

1342 verbose Darwin 21.6.0
1343 verbose node v16.17.1
1344 verbose npm v8.15.0
1345 error code ETARGET
1346 error notarget No matching version found for babel-plugin-transform-react-jsx@^7.19.0.
1347 error notarget In most cases you or one of your dependencies are requesting
1347 error notarget a package version that doesn't exist.
1348 verbose exit 1

@atilajanosi

atilajanosi commented Oct 20, 2022

Copy link
Copy Markdown

image

npm install @babel/traverse@^7.19.6
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/traverse@^7.19.6.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

@adrox37

adrox37 commented Feb 20, 2023

Copy link
Copy Markdown

notarget No matching version found for @babel/parser@^7.21.0

image

@anatoliip33

Copy link
Copy Markdown

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/types@^7.22.18.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

@Widiskel

Copy link
Copy Markdown

npm ERR! code ETARGET npm ERR! notarget No matching version found for @babel/types@^7.22.18. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

ahhi got this problem too

@Widiskel

Copy link
Copy Markdown

npm ERR! code ETARGET npm ERR! notarget No matching version found for @babel/types@^7.22.18. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

but now fixed already

@eramudeep

Copy link
Copy Markdown

getting same error.

MicrosoftTeams-image

@ShayanBits

ShayanBits commented Sep 25, 2023

Copy link
Copy Markdown

I confirm @eramudeep 's finding:

We already checked whether it is the local npm registery's cache which causes this issue.
However seeing the number of downloads (0) , 4 hours after the publish can confirm there must be something wrong.

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/types@^7.23.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

CleanShot 2023-09-25 at 1 54 14@2x

@nicolo-ribaudo

Copy link
Copy Markdown

However seeing the number of downloads (0) , 4 hours after the publish can confirm there must be something wrong.

Please contact the npm support

@ShayanBits

Copy link
Copy Markdown

UPDATE: it has been fixed after one day. 👍

@KobloshAlex

Copy link
Copy Markdown

2024-01-25 13:00:57.260 npm ERR! code ETARGET
2024-01-25 13:00:57.260 npm ERR! notarget No matching version found for @babel/traverse@^7.23.9.
2024-01-25 13:00:57.260 npm ERR! notarget In most cases you or one of your dependencies are requesting
2024-01-25 13:00:57.260 npm ERR! notarget a package version that doesn't exist.

npm error

@jainsachin121

Copy link
Copy Markdown

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/traverse@^7.24.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of '@babel/helpers'

Getting the same error again today after new version releases. Kindly look into this.
Error

@jainsachin121

Copy link
Copy Markdown

Is there a proxy between you and the npm registry? (for example a company proxy, a verdaccio instance, or something like cnpmjs.org) Yes -> It's a problem with that proxy, its cache needs to be updated No -> It might be a bug with the npm registry

Yes we have a company proxy but why issue with these babel packages only?, Everyday lot many packages published and we have not encountrer this issue with any other npm package. If you can provide more insite then it will really helpful.

@nicolo-ribaudo

nicolo-ribaudo commented Mar 22, 2024

Copy link
Copy Markdown

Yes we have a company proxy but why issue with these babel packages only?, Everyday lot many packages published and we have not encountrer this issue with any other npm package. If you can provide more insite then it will really helpful.

Because we publish many packages (sometimes more than 100) in a short span of time (less than a minute usually), and some proxies fetch a few of them and not the others.

@jenroques

Copy link
Copy Markdown

Seeing issues with the new 7.24.6 version across various packages. Any idea when this will be available again? Currently seeing build failures inside of piplines because of the packages not being available.

@nicolo-ribaudo

Copy link
Copy Markdown

It really depends on which proxy is sitting between you and npm. I have seen proxies that break for weeks, others that needs a couple hours, and others that work as they should.

@jenroques

Copy link
Copy Markdown

Understood, but I do see the new version is still at 0 downloads and was published 3 hours ago. Wanted to check.

@asotogsf

Copy link
Copy Markdown

this issue started to happen today again in other app, this is my test
➜ unknown-pkg-test ls
package.json
➜ unknown-pkg-test npm i @babel/helper-module-transforms@7.24.8
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/helper-module-transforms@7.24.8.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/asoto/.npm/_logs/2024-07-11T15_34_55_327Z-debug-0.log
➜ unknown-pkg-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment