Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native init fails with Couldn't find preset "react" relative to directory #7032

Closed
arunabha opened this issue Apr 18, 2016 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@arunabha
Copy link

Running react-native init aborts with error 'Error: Couldn't find preset "react" relative to directory "/Users/agh/dev"'

The detailed error is

react-native init test
This will walk you through creating a new React Native project in /Users/agh/dev/test-react/test
Installing react-native package from npm...
/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372
          throw new Error("Couldn't find preset " + JSON.stringify(val) + " relative to directory " + JSON.stringify(dirname));
          ^

Error: Couldn't find preset "react" relative to directory "/Users/agh/dev"
    at /Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
    at OptionManager.mergePresets (/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
    at OptionManager.mergeOptions (/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
    at OptionManager.addConfig (/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
    at OptionManager.findConfigs (/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:16)
    at OptionManager.init (/Users/agh/dev/test-react/test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:461:12)
    at compile (/Users/agh/dev/test-react/test/node_modules/babel-register/lib/node.js:81:45)
    at loader (/Users/agh/dev/test-react/test/node_modules/babel-register/lib/node.js:126:14)

I have a fresh install of node (5.10.1) and npm (3.8.3) through nvm.

I followed the suggestions listed here, however none of them helped.

The log from react-native init is attached
install.txt

Any help is greatly appreciated :-)

@mauricesvay
Copy link

Removing the .babelrc file in the folder solved the problem for me (/Users/agh/dev in your case).

@arunabha
Copy link
Author

Yep, that did the trick :-)

Thanks Maurice !

On Fri, Apr 22, 2016 at 3:25 PM, Maurice Svay notifications@github.com
wrote:

Removing the .babelrc file in the folder solved the problem for me (
/Users/agh/dev in your case).


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#7032 (comment)

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants