我正在开发一个 React Native 应用程序。我的代码没有错误,但它面临构建问题。当我执行命令react-native run-android 时,我在 Metro Bundler 中收到错误。错误说:
UnhandledPromiseRejectionWarning: Failed to start watch mode.
Run Code Online (Sandbox Code Playgroud)
我还尝试使用命令 add watchman 将$yarnWatchman 添加到 node_modules 。我收到提示说它已被弃用。
我应该如何解决该错误?
我的 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"
}
Run Code Online (Sandbox Code Playgroud)