运行react-native init 新建0.57.1项目运行报错 【`@babel/runtime/helpers/interopRequireDefault` does not exist】

在2018年9月,用户遇到了一个错误,当尝试运行react-native init创建的0.57.1版本项目时,系统提示`@babel/runtime/helpers/interopRequireDefault`模块不存在。这个错误可能与Facebook的react-native问题#4968有关。为了解决这个问题,用户可以尝试四个步骤:清除watchman缓存、删除node_modules并重新安装、重置Metro Bundler缓存以及移除haste缓存。
摘要由CSDN通过智能技术生成

2018-09-29 16:02:11.285108+0800 MyProject[42509:331244] Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module `@babel/runtime/helpers/interopRequireDefault` from `/Users/hjs/Desktop/worksplace/MyProject/index.js`: Module `@babel/runtime/helpers/interopRequireDefault` does not exist in the Haste module map

 

This might be related to https://github.com/facebook/react-native/issues/4968

To resolve try the following:

  1. Clear watchman watches: `watchman watch-del-all`.

  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.

  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值