React Native永远挂起

React Native hangs forever

本文关键字:挂起 永远 Native React      更新时间:2023-09-26

我在尝试为React-Native安装新项目时遇到了一个问题。它挂在下面:

react-native@0.33.0` requires a peer of react@~15.3.1 but none was installed.
npm verb exit [ 0, true ]
npm info ok

它永远停留在那里。

npm 3.10.7
node 6.2.1

我也遇到了这个问题,可以确认问题是watchman。我使用自制软件卸载/重新安装,仍然遇到同样的问题。我的解决步骤如下:

  • 卸载watchman with homebrew

  • 删除/usr/local/var/run/watchman/文件夹的内容

  • 重新安装watchman

我能够从这两个github问题中找出删除watchman文件夹内容的额外步骤:——https://github.com/facebook/watchman/issues/361——https://github.com/facebook/watchman/issues/358 issuecomment - 246672605

经过几天的运行,问题是Watchman,卸载并重新安装再次工作

尝试以下步骤:

  1. 移除当前监视器:watchman watch-del-all
  2. 删除node_modules文件夹
  3. 运行npm cache clean -f
  4. 运行npm install

检查你的react native项目现在是否可以在你的模拟器上运行:react-native run-ios