Error While run react-native run-ios. Error: Cannot find module 'metro-config'
Error While run react-native run-ios. Error: Cannot find module 'metro-config'
我正在 运行 通过终端使用 react-native 运行-is 命令来创建 React-native 项目。我想在模拟器中 运行 它。首先我 运行 npm install,然后是 react-native 运行-ios。它显示错误
Error: Cannot find module 'metro-config'
Require stack:
- /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-native-cli/index.js
您似乎没有安装 Metro-config
模块。安装此模块。
npm i metro-config --save-dev
我正在 运行 通过终端使用 react-native 运行-is 命令来创建 React-native 项目。我想在模拟器中 运行 它。首先我 运行 npm install,然后是 react-native 运行-ios。它显示错误
Error: Cannot find module 'metro-config' Require stack: - /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-native-cli/index.js
您似乎没有安装 Metro-config
模块。安装此模块。
npm i metro-config --save-dev