npm ERR! notarget No matching version found for @eslint/eslintrc@^2.1.4.

这篇具有很好参考价值的文章主要介绍了npm ERR! notarget No matching version found for @eslint/eslintrc@^2.1.4.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Intro

事由是今天我在用 create-react-app 新建一个用于测试的前端项目。
然后就出现以下报错:

wuyujin1997@wyjmacm1 Coderepo % create-react-app my-app          

Creating a new React app in /Users/wuyujin1997/Coderepo/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @eslint/eslintrc@^2.1.4.
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/wuyujin1997/.npm/_logs/2023-12-02T11_24_38_818Z-debug-0.log

截图见下(核心错误行已标红):
no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源

解决流程

总结

首先,我怀疑了自己的 create-react-app node npm 的版本,怀疑了自己的网络问题,怀疑了我当前的操作目录问题。
这些都不是。

最终发现,是因为我自己的npm指定的镜像源registry 中,的的确确是没有该版本的该依赖!!
而切换了一个镜像源之后重新跑命令,就可以成功。

前置信息了解

npm 镜像源

我目前记录了三个,见下(第一行是npm默认的、官方的镜像源):

https://registry.npmjs.org/
https://registry.npm.taobao.org/
https://mirrors.huaweicloud.com/repository/npm/
三个要用到的npm命令

如何查看、设置镜像源registry的值

npm config get registry
npm config set registry 要设置的新的registry值

no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源如何查看(在当前镜像源下)某个依赖的信息?

npm view @eslint/eslintrc@^2.1.4
npm view @eslint/eslintrc

npm view后跟的依赖名,可指定具体版本,也可以不指定版本(若不指定版本,则会查询最新版本的该依赖包信息)。

官方源确认

首先去 npmjs.comeslintrc 这个依赖,具体页面:https://www.npmjs.com/package/@eslint/eslintrc
注意红框中的信息:
现在是 2023-12-02 20:09 pm这个依赖在15小时前才发布了最新的依赖版本 2.1.4
也就是说 @eslint/eslintrc@^2.1.4 这个版本的依赖在官方是存在的,只不过这个版本刚发布不久。【注意这句结论】
no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源

查看当前镜像源的详情

两个步骤:

  1. 看当前镜像源是哪个?
  2. 在当前镜像源下,查看我们需要的依赖包是否存在?
    no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源
    以上执行了三条命令:
npm config get registry		# 1. 当前镜像源是华为云
npm view @eslint/eslintrc@^2.1.4  # 2. 指定版本,没查到结果。【华为云没有2.1.4版本的这个依赖?】
npm view @eslint/eslintrc       # 2. 不指定版本,返回的结果是 2.1.3 版本的依赖。

注意两个红圈处,说结论:
在使用华为云镜像源时,eslintrc依赖只更新到 2.1.3 ,而没有官方最新的 2.1.4 。
(镜像源之间的同步有些延时,是完全正常的。只要依赖包的范围别太大,延时的时间别太长就行)

解决: 切换镜像源后重试

现状:华为云目前还没同步到 eslintrc 依赖的最新版本 2.1.4 依赖包。
所以,我们可以换别的镜像源后再试试。

运行命令及结果文本如下:

wuyujin1997@wyjmacm1 Coderepo % 
wuyujin1997@wyjmacm1 Coderepo % npm config set registry https://registry.npm.taobao.org/
wuyujin1997@wyjmacm1 Coderepo % 
wuyujin1997@wyjmacm1 Coderepo % npm config get registry                                 
https://registry.npm.taobao.org/
wuyujin1997@wyjmacm1 Coderepo % 
wuyujin1997@wyjmacm1 Coderepo % npm view @eslint/eslintrc@^2.1.4

@eslint/eslintrc@2.1.4 | MIT | deps: 9 | versions: 39
The legacy ESLintRC config file format for ESLint
https://github.com/eslint/eslintrc#readme

keywords: ESLint, ESLintRC, Configuration

dist
.tarball: https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz
.shasum: 388a269f0f25c1b6adc317b5a2c55714894c70ad
.integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==
.unpackedSize: 658.7 kB

dependencies:
ajv: ^6.12.4                globals: ^13.19.0           js-yaml: ^4.1.0             
debug: ^4.3.2               ignore: ^5.2.0              minimatch: ^3.1.2           
espree: ^9.6.0              import-fresh: ^3.2.1        strip-json-comments: ^3.1.1 

maintainers:
- openjsfoundation <npm@openjsf.org>
- eslintbot <nicholas+eslint@nczconsulting.com>

dist-tags:
latest: 2.1.4  

published 14 hours ago by eslintbot <nicholas+eslint@nczconsulting.com>
wuyujin1997@wyjmacm1 Coderepo % 

运行截图如下,注意红圈部分表示切换到淘宝的镜像源后,查到了 eslintrc@2.1.4 依赖包的信息。
no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源

重新操作

我们发现了华为云的镜像源中暂时没有同步到最新版本的 @eslint/eslintrc@^2.1.4 依赖包,
切换到淘宝镜像源后发现有我们想要的依赖包。
这是再重试我们一开始报错的 create-react-app my-app命令试试:
no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源
我成功了!

事后感受

作为一个程序员,在编程过程中遇到报错,又通过多方查证、试验解决了该问题,这个过程让人迷惑无助但结果会让人痛快,有一说为进入心流状态。

我好久没有这种痛快感了,于世去翻了一下在本文之前的最近的4条、记录在我的博客中、对我开发过程中bug的发现和解决过程的文章:

  • 2023-05-28 12:31:47 An enum switch case label must be the unqualified name of an enumeration constant
  • 2023-02-22 07:32:38 Interface type cannot be statically allocated
  • 2023-02-19 19:35:11 Error: Timeout trying to fetch resolutions from npm
  • 2023-02-19 12:18:11 blackduck issue fix

从2月份到现在,才记录了4次,今年的状态真的不好。

是懒惰,是懈怠,理想逐渐磨灭。

希望以后少点玩乐,多做点正事。

附加几句:
我个人目前认为镜像源的提供者还是好意,自己提供服务器资源来加速国内开发者对依赖包的下载,还是要表示感谢。
至于单一依赖或少量依赖的同步延时,还是前面那句话:
只要不是大量依赖的新版本同步的延时过长,就没有大问题。

所以不希望任何人因为本次将华为云切换到淘宝云就解决了下载eslintrc最新版本的问题,而认为哪个比哪个好,哪个比哪个差。
灵活运用不同资源即可。

华为云再测试

两天后,我再次切回华为云的镜像源,查看 eslintrc 的最新版本,发现 2.1.4 已经有了:
no matching version found for @eslint/eslintrc@^2.1.4.,配置,Bug,npm,registry,notarget,eslintrc,淘宝云,华为云,镜像源文章来源地址https://www.toymoban.com/news/detail-763809.html

到了这里,关于npm ERR! notarget No matching version found for @eslint/eslintrc@^2.1.4.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 已解决ERROR: No matching distribution found for xpinyin

    已解决(pip使用阿里云镜像安装第三方模块失败)ERROR: Could not find a version that satisfies the requirement xpinyin (from versions: none) ERROR: No matching distribution found for xpinyin WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS w

    2023年04月20日
    浏览(35)
  • ERROR: No matching distribution found for gradio>=3.23

    今天运行chatGPTweb项目的时候 跟下载其他包时候一样使用清华源下载的时候,pip install gradio==3.23 -i https://pypi.python.org/pypi 然后, 报错了 。 国内的镜像源还没有更新到 gradio=3.23,所以需要科学上网,手动去pypi官网下载whl,然后通过whl下载即可。 1.从官网中下载gradio编译的pyd文

    2024年02月11日
    浏览(40)
  • No matching distribution found for torch==1.10.1+cu111

    30系显卡暂时不支持CUDA11以下版本,CUDA不支持当前显卡的算力。 解决方法1:https://blog.csdn.net/weixin_43760844/article/details/115706289 解决方法2:conda下载cudatoolkit (貌似没有解决问题, 嘿嘿, 可能只能卸载cuda了) 首先搜索安装包的版本 然后安装固定版本的cudatoolkit,我的cuda最高

    2024年02月07日
    浏览(32)
  • 已解决ERROR: No matching distribution found for gradio==3.23

    已解决stderr: ERROR: Could not find a version that satisfies the requirement gradio==3.23 ERROR: No matching distribution found for gradio==3.23 粉丝群里面的一个小伙伴遇到问题跑来私信我,想用pip安装gradio ,但是发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记

    2023年04月18日
    浏览(32)
  • jenkins构建时,报错ERROR: No matching distribution found for pywin32==305

    最近用jenkin构建了一个任务,控制台输出,出现如下报错信息: ERROR: Could not find a version that satisfies the requirement pywin32==305 (from versions: none) ERROR: No matching distribution found for pywin32==305 Build step \\\'Execute shell\\\' marked build as failure Finished: FAILURE   原因: requirement是需要导入的依赖包文件

    2023年04月27日
    浏览(32)
  • [Vue Router warn]: No match found for location with path “xxxxx“

    在vue项目中,大家做权限管理的时候,大部分是采用addRoute方案来实现。 在之前使用vue-router的时候,大家在动态追加完路由后,还要再追加一下404页面,如果在路由文件中直接写好404页面,那么刷新页面的时候就会跳转到404页面,原因在于,我们在加动态路由前,就配置了通

    2024年02月12日
    浏览(28)
  • python3安装及pip3 报ERROR: No matching distribution found for

    python3 pip Install Error: No matching distribution found for 安装openssl 安装python3 可能会报错: zipimport.ZipImportError: can’t decompress data 解决方法:

    2024年02月14日
    浏览(34)
  • 解决报错ERROR: No matching distribution found for torchvision==0.11.2+cu111

    目录 一、猜测 二、验证 三、解决方案 四、检验 该报错是在按官网方法用指令: 安装pytorch时出现的,以下是分析: 这个错误提示表明在指令提供的下载网址上没有找到符合要求的torchvision软件包版本,需要安装符合要求的版本。问题可能出在指定的版本号(0.11.2+cu111),这

    2024年02月11日
    浏览(28)
  • Python安装tensorflow过程中出现“No matching distribution found for tensorflow”的解决办法

    在Pycharm中使用 pip install tensorflow 安装tensorflow时报错: 搜了好多帖子有的说可能是网络的问题,需要换国内的镜像源来下载,于是改用清华源: 依旧没用,折腾了好久,才发现我目前的Python版本是Python3.8(32位)的,可能是tensorflow对python3.8还不支持,所以得 降低python版本 (好

    2024年02月03日
    浏览(32)
  • Python安装selenium时报错:ERROR: No matching distribution found for selenium 附解决方法

    报错如下: 通过该方法可以成功解决报错:

    2024年02月05日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包