【问题标题】:React Native - error attachToServer is not a functionReact Native - 错误 attachToServer 不是函数
【发布时间】:2022-06-26 04:15:30
【问题描述】:

命令后:npx react-native start

TypeError: attachToServer is not a function
    at Object.runServer [as func] (E:\WiemIleJem\WiemCoJem\node_modules\@react-native-community\cli-plugin-metro\build\commands\start\runServer.js:131:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.handleAction (E:\WiemIleJem\WiemCoJem\node_modules\@react-native-community\cli\build\index.js:192:9) ```

It's clean project created by command: npx react-native init

【问题讨论】:

    标签: node.js react-native


    【解决方案1】:

    我可以通过安装@react-native-community/cli解决这个问题

    npm i @react-native-community/cli --save-dev

    【讨论】:

    • 你是最棒的!谢谢,它有效。
    • 没有为我解决,仍然有这个问题。我在大约 2 小时前看到了最近的 react-native 更新。我怀疑一个错误的版本。尝试使用react-native init newproject --version X.XX.X
    • 这是 GitHub 问题以保持最新状态。 github.com/react-native-community/cli/issues/1561
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-09
    • 2021-11-30
    • 1970-01-01
    • 2018-01-08
    相关资源
    最近更新 更多