Response-native init gives an error: could not find the pre-installed "es2015"

When I try to start a new project with a reaction from scratch, I get 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" 

Of course, I installed action-native-cli. Using node v4.2.1, react-native 0.1.5, watchdog and thread are also installed.

Something seems to be related to babel. However, I cannot understand the reason.

I am attaching a screenshot with a more detailed output.

Output error

Thanks in advance!

+7
ecmascript-6 babeljs react-native
source share
5 answers

It listened to me for a good 1 day. The problem was that I had a .babelrc file in my file hierarchy, which interfered with parsing pars. I got rid of it, and everything was in order. Interactive-native uses es2015 by default, so .babelrc is not required.

+7
source share

Try installing the following packages

 npm install babel-preset-es2015 --save npm install babel-preset-react --save 
+6
source share

I had the same problem. The solution for me was to switch from "workspace / MyProject" (for you "/ Users / jorgevenegas / Dev / Projects", I think) to "workspace".

I don’t know why I had to do this, but when I started

 npm install babel-preset-es2015 npm install babel-preset-react 

in my workspace instead, I could cd to "MyProject" again and run the debug-run-android from there.

I hope that at least some people will face the same problem.

+1
source share

Add the following line to the .babelrc file:

 {"presets": ["react"]} 

I find a solution from babel.io

+1
source share

I went through something similar, maybe this can help. In my case, this was because for some reason I had two instances of action-native installed on my system.

Check output

 which -a react-native 

If you get more than one path with native response set, get rid of the one that gives you the same error when executing init directly with the full path (my case was set to / usr / local / bin / native, but yours may be slightly different).

After removing the wrong one, you should be able to run projects without any problems.

0
source share

All Articles