React Native :选项对象无效,已使用与API架构不匹配的选项对象初始化开发服务器

hi3rlvi2  于 2022-11-17  发布在  React
关注(0)|答案(1)|浏览(113)

我正在尝试启动React-Native项目。
在终端中我所做的仅有的两个命令是:

npx create-expo-app rate-repository-app --template expo-template-blank@sdk-46

npx expo install react-native-web@~0.18.7 react-dom@18.2.0 @expo/webpack-config@^0.17.0

我得到了以下错误:

ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'mimeTypes'. These properties are valid:
   object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

我想做的只是开始一个项目--除此之外我什么也没做。
如何避免错误?

isr3a4wc

isr3a4wc1#

将webpack-dev-server降级到3.10.1

npm i webpack-dev-server@3.10.1

似乎React Native无法与webpack-dev-server〉4.0.0一起使用

相关问题