Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 无法启动Watchman监视模式_React Native_Watchman - Fatal编程技术网

React native 无法启动Watchman监视模式

React native 无法启动Watchman监视模式,react-native,watchman,React Native,Watchman,我正在开发一个React原生应用程序。我的代码没有错误,但它面临构建问题。当我执行命令react native run android时,Metro Bundler中出现了一个错误。错误显示: UnhandledPromiseRejectionWarning: Failed to start watch mode. 我还尝试使用命令添加Watchman到node_模块。 我得到一个提示,它已被弃用 我应该如何解决错误 My package.json包含以下内容: "dependencies":

我正在开发一个React原生应用程序。我的代码没有错误,但它面临构建问题。当我执行命令react native run android时,Metro Bundler中出现了一个错误。错误显示:

UnhandledPromiseRejectionWarning: Failed to start watch mode.
我还尝试使用命令添加Watchman到node_模块。 我得到一个提示,它已被弃用

我应该如何解决错误

My package.json包含以下内容:

"dependencies": {
    "expo": "^25.0.0",
    "native-base": "^2.3.7",
    "react": "16.2.0",
    "react-native": "0.52.0",
    "react-native-vector-icons": "^4.5.0",
    "react-navigation": "^1.0.0-beta.27",
    "watchman": "^1.0.0"
}

"devDependencies": {
    "babel-jest": "22.1.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.1.3",
    "react-test-renderer": "16.2.0"
  }

您必须使用brew安装watchman:

brew install watchman

要让windows中的watchman执行以下操作:
(1) 从链接下载watchman zip文件
(2) 解压缩文件夹
(3) 将watchman.exe文件放在路径(环境变量)中注册的文件夹中(例如:将watchman.exe文件放在C:/ProgramFiles/中,并确保路径='C:/ProgramFiles')


完成了!你再也不会面对这个错误了

无法启动Watchman监视模式(Windows)


我尝试了很多来修复这个问题,最后,我重新启动了我的windows,现在它可以工作了

在windows
npm install watchman
中,我也遇到了同样的问题

  • 删除节点模块,并使用npm安装重新安装它们
  • 然后按“.\gradlew”清洁gradle
  • 然后通过“npx react native run android”运行应用程序

  • 以上步骤帮助我解决了错误。

    我使用Android emulator…我做了“添加watchman”。我已将watchman文件夹添加到node_模块中,但自述文件说它是一个不推荐使用的包,我在watchman文件夹中找不到任何index.js。您不想将watchman作为依赖项安装:)查看我的repo:。有安装说明。我最近重新安装了macbook,当我按照上面提到的所有步骤操作时,运行我的应用程序没有问题。如果您可以运行我的存储库,那么您的存储库有问题。如果无法运行“我的存储库”,则应考虑在计算机上重新安装react native。