【发布时间】:2021-09-29 19:26:58
【问题描述】:
我正在从命令行运行以下命令:
npx react-native init AwesomeProject
...我在 React 徽标后看到以下输出:
Welcome to React Native!
Learn once, write anywhere
✖ Downloading template
error Error: Command failed: yarn add react-native@latest
error Couldn't find any versions for "@jest/types" that matches "^27.2.4"
warning react-native > @react-native-community/cli-platform-ios > xcode > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
...
yarn add v1.22.11
info No lockfile found.
[1/4] Resolving packages...
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
为什么抱怨?
【问题讨论】:
-
它似乎是最新版本的
react-native的问题。如果我针对以下package.json运行yarn,那很好:{ "name": "awesometsproject", "version": "0.0.1", "dependencies": { "react": "17.0.1", "react-native": "0.64.0" } }...但如果我将react-native版本更改为0.65.1,我会收到以下错误:Couldn't find any versions for "@jest/types" that matches "^27.2.4"
标签: reactjs react-native npx