react-native - 运行 react-native run-ios 时出错。错误:找不到模块“metro-config”
问题描述
我正在使用 react-native run-is 命令通过终端运行 React-native 项目。我想在模拟器中运行它。首先我运行 npm install ,然后是 react-native run-ios。它显示错误
错误:找不到模块“metro-config”需要堆栈:-/Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/local-cli/util/Config.js-/Users/tribond/Projects/JustHelper/ justhelper2/node_modules/react-native/local-cli/core/index.js - /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/local-cli/cliEntry.js - /Users/tribond/Projects/ JustHelper/justhelper2/node_modules/react-native/local-cli/cli.js - /Users/tribond/Projects/JustHelper/justhelper2/node_modules/react-native/cli.js - /usr/local/lib/node_modules/react-本机-cli/index.js
解决方案
您似乎没有Metro-config
安装任何模块。安装此模块。
npm i metro-config --save-dev
推荐阅读
- python - Python按多列压缩行 - groupby 丢弃不应该的组?
- javascript - 在 JHipster (v5.82) 项目中包含自定义类型
- java - 如何在 TextView 上显示 Auto Scrolling RecyclerView 位置?
- python - 使用 pandas 优化应用于系列的散列
- github - 发布时如何关闭 GitHub 生成(和损坏)的 tarball?
- android - 使用整数值动态更改按钮颜色
- excel - Excel:求和仅在可见单元格上重复一次值
- laravel - 迁移的外键问题
- objective-c - NSCollectionViewGridLayout 在单行中,可调整大小的集合项保持纵横比?
- terraform - 如何将逗号分隔的数组传递给 terraform v0.12.0 中的资源?