首页 > 解决方案 > 每个项目的 react-native start 都失败

问题描述

我一直在我的 MacBook Pro 上开发一个 react-native 应用程序,但现在被迫使用我的桌面 Windows 机器。我什至无法让服务器开始使用这个项目npm startreact-native start --reset-cache一个全新的react-native init应用程序。我收到此错误消息:

我确保运行 npm install 和 react-native link

使用:* 节点 10.16.0 * npm 6.9.0 * react-native-cli 2.0.1 * “react”:“16.8.3”,* “react-native”:“0.59.4”,

npm start --reset-cache
react-native start --reset-cache

warning: the transform cache was reset.
Loading dependency graph...events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: UNKNOWN: unknown error, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
Emitted 'error' event at:
    at NodeWatcher.checkedEmitError (H:\sampleproject\node_modules\metro\node_modules\sane\src\node_watcher.js:143:12)
    at FSWatcher.emit (events.js:198:13)
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:129:12)

标签: javascriptreact-native

解决方案


我已经克隆了存储库并在 H: 驱动器中创建了项目,但是一旦我在 C: 驱动器中运行项目,它就会按预期工作。


推荐阅读