npx create-react-app my-app 时候报错,并且创建好的my-app目录也删除了

完整报错信息

Creating a new React app in /Users/kevinsu/devCode/sumaolin/demo/hooks-demo.

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 @typescript-eslint/scope-manager@5.32.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.

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting hooks-demo/ from /Users/kevinsu/devCode/sumaolin/demo
Done.

关键信息是 @typescript-eslint/scope-manager@5.32.0 这个依赖包不存在,查了下npmjs.org 官网有对应的版本:@typescript-eslint/scope-manager - npm (npmjs.com)

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @typescript-eslint/scope-manager@5.32.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.

npm registry 使用的是taobao 的,怀疑是不是没同步这个 package 过来,实用npm registry 管理工具 nrm 切换成了 npm 官网的 registry 重试了下,虽然有点慢但是成功了。

后面去 taobao registry 查询是不是这个 @typescript-eslint/scope-manager@5.32.0 版本是否存在,发现 taobao registry 域名迁移了,猜想是这个原因造成的

1. nrm - npm registry管理工具_wyc_cs的博客-CSDN博客_npm registry 管理
2. 淘宝 NPM 镜像站切换新域名啦 - 知乎 (zhihu.com)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值