0

I'm running the following from the command line:

npx react-native init AwesomeProject

...and I see the following output after the React logo:

                  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.

Why is it complaining?

  • It *seems* like it's an issue with the latest version of `react-native`. If I run `yarn` against the following `package.json`, it's fine: `{ "name": "awesometsproject", "version": "0.0.1", "dependencies": { "react": "17.0.1", "react-native": "0.64.0" } }` ...but if I change the `react-native` version to `0.65.1` I get the following error: `Couldn't find any versions for "@jest/types" that matches "^27.2.4"` – ThisRestlessPilgrim Sep 29 '21 at 19:59

2 Answers2

0

Is it possible that you have mistakenly written the dependency's name? Isn't it @types/jest instead? See https://www.npmjs.com/package/@types/jest

Hung Vu
  • 360
  • 3
  • 11
0
  1. uninstall node
  2. reinstall using package manager like 'homebrew'
  3. try again 'npx react-native init project'