http节点模块中没有aplication.js

No aplication.js in http node module

当我尝试在 ios 或 android 上 运行 我的 react-native 应用程序时,Metro Bundler 会报错说我没有安装 http 模块.

我已经尝试 npm react-native install http 并且安装正确,但是当我上传应用程序时出现此错误:

错误:捆绑失败:错误:尝试从文件 /node_modules/express/lib/application.js 解析模块 http 时,已成功找到程序包 node_modules/http/package.json。但是,这个包本身指定了一个无法解析的 main 模块字段 (node_modules/http/index.js.

我刚刚弄清楚为什么会出现此错误。我试图以错误的方式使用变量样式