gpt4 book ai didi

node.js - React Native - 运行 "npm start"和 "react-native run-android"时出错

转载 作者:行者123 更新时间:2023-12-04 13:20:08 26 4
gpt4 key购买 nike

昨天我的 React Native 项目运行良好,但是今天在我打开我的 React Native 项目并运行“npm start ”或“react native-run-android ”后,没有添加任何代码或库,但它现在总是给我错误。我只是很困惑我什么也没做,但我遇到了错误。

这是我通过运行“npm start”或“react-native run-android”得到的错误:

Loading dependency graph...events.js:167 throw er; // Unhandled 'error' event ^

Error: UNKNOWN: unknown error, lstat 'D:\React Native Projects\TheProject\node_modules\babel-register'

Emitted 'error' event at: at NodeWatcher.checkedEmitError (D:\React Native Projects\TheProject\node_modules\sane\src\node_watcher.js:159:10) at Walker.emit (events.js:182:13) at D:\React Native Projects\TheProject\node_modules\walker\lib\walker.js:52:12 at D:\React Native Projects\TheProject\node_modules\graceful-fs\polyfills.js:282:31 at FSReqWrap.oncomplete (fs.js:154:21)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! TheProject@0.0.1 start: node node_modules/react-native/local-cli/cli.js start npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the TheProject@0.0.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

最佳答案

最简单的方法是在 mac 中安装 Watchman:

$ brew update
$ brew install watchman
如果您没有 brew,请先执行以下操作:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

关于node.js - React Native - 运行 "npm start"和 "react-native run-android"时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54209514/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com