【问题标题】:Troubles after upgrading react-native to 0.56react-native 升级到 0.56 后的问题
【发布时间】:2018-12-31 22:19:18
【问题描述】:

我在更新新版本的 react-native 时遇到了麻烦,它似乎有了很大的改进和很多功能。

看完这篇文章: https://facebook.github.io/react-native/blog/2018/07/04/releasing-react-native-056

我已经开始运行这个命令了:https://facebook.github.io/react-native/docs/upgrading.html

一切顺利,运行后构建应用react-native run-ios

问题是有问题的捆绑包:

节点 node_modules/react-native/local-cli/cli.js 开始“--reset-cache” 扫描文件夹中的符号链接 /Users/julestruong/Dev/BAP/flex/v1/flex-mobile-app/node_modules (14ms) 警告:转换缓存已重置。

找不到模块“metro/src/transformer”

npm 错误!代码 ELIFECYCLE npm 错误! errno 1 npm 错误! flex@0.0.1 开始: node node_modules/react-native/local-cli/cli.js start "--reset-cache" npm 错误!退出状态 1 npm ERR! npm 错误!失败于 flex@0.0.1 启动脚本。 npm 错误!这可能不是问题 与 npm。上面可能还有额外的日志输出。

npm 错误!可以在以下位置找到此运行的完整日志:

尝试:

  • 删除节点模块
  • 开始 --reset-cache
  • 删除 package-lock.json 并重新安装。

没有任何效果...

【问题讨论】:

标签: reactjs facebook react-native


【解决方案1】:

如果您使用的是 typescript,则需要将 react-native-typescript-transformer 升级到 1.2.10,因为 metro 移动了它所依赖的变压器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-13
    • 1970-01-01
    • 1970-01-01
    • 2021-09-07
    • 2022-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多