创建反应应用程序:npm 错误! notarget 找不到 toidentifier@1.0.1 的匹配版本
我正在尝试像往常一样使用 create-react-app 创建一个新的 React 项目:
npx create-react-app .
但我收到一个错误:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
我已经检查过,并且 repo 中提供了 toidentifier 1.0.1 包。 我不明白为什么我会收到此错误。
在使用 react-scripts
的现有项目上尝试 npm i
时,我也会遇到相同的错误。 该错误是最近才出现的,我以前从未遇到过此类问题。
我正在使用节点 17.0.1 和 npm 8.1.0 可能出什么问题了?
编辑:我也尝试过使用node 17.6.0和npm 8.5,同样的事情发生了
I'm trying to create a new react project with create-react-app as usual :
npx create-react-app .
But I'm getting an error :
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
I've checked and the package toidentifier 1.0.1 is available in the repo.
I don't understand why I'm getting this error.
I am also able to get the same error when trying to npm i
on an existing project that uses react-scripts
.
The error is quite recent, I've never had any problem of this kind previously.
I'm using node 17.0.1 and npm 8.1.0
What could be wrong ?
Edit : I also tried with node 17.6.0 and npm 8.5 and the same thing happens
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您遇到相同的错误,可能是由于您的本地 npm 缓存不是最新的且不一致。
运行
npm cache clean --force
以确保更新包和依赖项列表。这发生在我的
toidentifier
包中,它是各种包中使用的低级依赖项,包括一些 webpack 依赖项。其他一些软件包也可能会出现此错误。If you encouter the same error, it's probably due to your local npm cache which isn't up to date and inconsistent.
Run
npm cache clean --force
to ensure that the package and dependencies lists will be updated.This happened to me with the
toidentifier
package which is a low-level dependency used in various packages, including some webpack dependencies. It's likely that this error may occur with some other packages.