创建react应用程序:npm ERR!notarget找不到的匹配版本toidentifier@1.0.1.



我正试图像往常一样用create-react应用程序创建一个新的react项目:

npx create-react-app .

但我得到了一个错误:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for toidentifier@1.0.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.

我已经检查过了,软件包标识符1.0.1在回购中可用。我不明白为什么我会犯这个错误。

在使用react-scripts的现有项目上尝试npm i时,我也会遇到同样的错误。这个错误是最近才出现的,我以前从未遇到过这种问题。

我使用的是节点17.0.1和npm 8.1.0可能出了什么问题?

编辑:我也尝试了节点17.6.0和npm 8.5,也发生了同样的事情

如果您遇到同样的错误,可能是由于您的本地npm缓存不及时且不一致。

运行npm cache clean --force以确保更新包和依赖项列表。

toidentifier包就是这样,它是各种包中使用的低级依赖项,包括一些webpack依赖项。这个错误很可能发生在其他一些软件包中。

最新更新