react-native init给出错误:找不到预设的“es2015” [英] react-native init gives Error: Couldn't find preset "es2015"

查看:177
本文介绍了react-native init给出错误:找不到预设的“es2015”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

X-4545454545 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X-用户/ jorgevenegas / Dev / Projects / testreact / List / node_modules / react-native / node_modules / babel-core / lib / transformation / file / options / option-manager.js:327
throw new Error(Couldn新新200新新新新新旗新新新旗新新旗新新旗旗新1992新新新新旗新新旗旗新1992新新新新旗新新旗200新新新新旗新新200新新新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗旗号200
^

错误:相对于目录/ Users / jorgevenegas / Dev / Projects找不到预设es2015

当然,我已经安装了反应本机。 X-45454545 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045 X- 20045。



我附加了更详细输出的屏幕截图。





感谢提前!

解决方案

这使我有一天好的1天。问题是我的文件层次结构中有一个.babelrc文件,它干扰了babel解析。摆脱了这一点,没关系。 react-native默认使用es2015,因此不需要.babelrc。


When I'm trying to start a new react-native project from scratch I'm getting this message.

/Users/jorgevenegas/Dev/Projects/testreact/List/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:327
          throw new Error("Couldn't find preset " + JSON.stringify(val) + " relative to directory " + JSON.stringify(dirname));
          ^

Error: Couldn't find preset "es2015" relative to directory "/Users/jorgevenegas/Dev/Projects"

I have installed react-native-cli, of course. Using node v4.2.1, react-native 0.1.5, watchman and flow installed too.

Seems to be something related to babel. I can't figure out the reason, though.

I'm attaching a screenshot with a more detailed output.

Thanks in the advance!

解决方案

This bugged me for a good 1 day. The issue was I had a .babelrc file up in my file hierarchy which was interfering with babel parsing. Got rid of that and it was fine. react-native uses es2015 by default so .babelrc is not required.

这篇关于react-native init给出错误:找不到预设的“es2015”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆