簡體   English   中英

運行創建的 React Native 項目時出錯

[英]Error when running created React Native project

我正在從命令行運行以下命令:

npx react-native init AwesomeProject

...我在 React 徽標后看到以下 output:

                  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.

它為什么抱怨?

有沒有可能是你寫錯了依賴的名字? 不是@types/jest 嗎? https://www.npmjs.com/package/@types/jest

  1. 卸載節點
  2. 使用 package 管理器重新安裝,例如“自制軟件”
  3. 再試一次'npx react-native 初始化項目'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM