react-native-community / cli

The React Native Community CLI - command line tools to help you build RN apps
MIT License
2.27k stars 890 forks source link

Getting Error While initialization react native app in ubuntu #2378

Open Harsh3341 opened 1 month ago

Harsh3341 commented 1 month ago

Ask your Question

While I'm initializing the react native app I'm receiving the following error: image

I have checked I have yarn version 1.22.19 on my machine

What could be a possible solution for it?

szymonrybczak commented 1 month ago

@Harsh3341 what's the output of yarn --version?

Harsh3341 commented 1 month ago

@Harsh3341 what's the output of yarn --version?

1.22.19

Harsh3341 commented 1 month ago

Now yarn issue is sorted but still I'm receiving image

km-saifullah commented 1 month ago

Have you solved your problem @Harsh3341 I am also facing the same problem Ubuntu 22.04

Harsh3341 commented 1 month ago

Have you solved your problem @Harsh3341 I am also facing the same problem Ubuntu 22.04

not yet

km-saifullah commented 1 month ago

@Harsh3341 If you solve this just mention here how you solve that okay Brother!

Harsh3341 commented 1 month ago

@szymonrybczak is there any solution?

km-saifullah commented 1 month ago

@Harsh3341 I have solved my problem by downgrading the version of React-native. Try to use the command below

npx react-native@0.70 init AwesomeProject --version 0.70

Harsh3341 commented 1 month ago

@Harsh3341 I have solved my problem by downgrading the version of React-native. Try to use the command below

npx react-native@0.70 init AwesomeProject --version 0.70

Thnx @km-saifullah it works, but it need to know why the latest version is causing such issue

km-saifullah commented 1 month ago

@Harsh3341 Welcome. Yes, I also search about this issue. But still did not get anything valuable from the internet.

szymonrybczak commented 1 month ago

hey, you shouldn't use 0.70.0 as a version becuase it's outdated and is not longer supported. Please run init command with --verbose option and reply with your error.

Harsh3341 commented 1 month ago

@szymonrybczak using npx react-native@latest init --verbose is working fine, just getting the following error now

cannot parse yarn version

rest everything is working correctly, I have also run the code and the template app is working fine.

but running the command npx react-native@latest init without --verbose is causing the error attached in the starting image, why is It so?

szymonrybczak commented 4 days ago

hey @Harsh3341!

just getting the following error now

cannot parse yarn version

If issue is still presented could you please try logging error under this statement?

https://github.com/react-native-community/cli/blob/4d65f1d113bf12ad08e1b817d3e2d9183272aeb8/packages/cli/src/tools/yarn.ts#L36

but running the command npx react-native@latest init without --verbose is causing the error attached in the starting image, why is It so?

Error thrown during project creation were catched by one catch statement related to Cocoapods installation failure 😅 It'll fixed once https://github.com/react-native-community/cli/pull/2394 lands.