Skip to content

react-native init fails in Windows 10 #21029

Closed
@ancodeUDW

Description

@ancodeUDW

Environment

React Native Environment Info:
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-7740X CPU @ 4.30GHz
Memory: 8.38 GB / 15.93 GB
Binaries:
npm: 6.2.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 2.2.0.0 AI-145.3360264

[skip envinfo]

Description

I develop with Windows. I started a new react-native project after updating react-native, using react-native init myApp. However, it fails before ending the the initialization of the project. The message it leaves is:

warning Unmet peer dependency "@babel/core@7.0.0-beta.47".
error An unexpected error occured, please open a bug report with the information provided in "C:\proyects\myapp\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
child_process.js:644
throw err;
^

Error: Command failed: yarn add jest babel-jest babel-preset-react-native@^5 react-test-renderer@16.4.1 --dev --exact
at checkExecSyncError (child_process.js:601:13)
at execSync (child_process.js:641:13)
at generateProject (C:\proyectos\react-native\cheerio2\myapp3\node_modules\react-native\local-cli\init\init.js:105:7)
at Object.init (C:\proyectos\react-native\cheerio2\myapp3\node_modules\react-native\local-cli\init\init.js:53:5)
at run (C:\Users\ancode\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302:7)
at createProject (C:\Users\ancode\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\ancode\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object. (C:\Users\ancode\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)

when checking C:\proyects\myapp\yarn-error.log" its two last lines said:

Trace:
Error: ENOENT: no such file or directory, open 'C:\proyecto\myApp\node_modules@babel\highlight\node_modules\ansi-styles\index.js'

If I try to do a
npm install

inside of the project's folder and when it is finished I execute
react-native run-android

it gives the following error (I assume that it is becuse it was not properly initialized):

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Before the update, I could use react-native init whitout any problem. I have been trying fixes and alternatives, like

react-native init {proj_name} --version react-native@0.55.4

but the same error arises. The only way I could create a react-native project by now is via "create-react-native-app", but it limits me because I cannot install native modules.

Reproducible Demo

react-native init myApp

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions