1

I have created a new app with npx react-native init. The installation is completed and I can run my app with npx, but it's giving me this error during installation:

⠋ Downloading templateerror Cannot parse yarn version: 0.32
⠴ Downloading templateerror Cannot parse yarn version: 0.32
✔ Downloading template
✔ Copying template
✔ Processing template
⠋ Installing dependencieserror Cannot parse yarn version: 0.32
✔ Installing dependencies

Similarly, if I run any yarn command like yarn start, it doesn't recognize it:

00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'start'

Writting yarn --version returns 0.32.

Vinyet
  • 21
  • 1
  • 6

2 Answers2

1

Yarn may be missing. Try installing it via npm:

sudo npm install yarn -g
maosanch
  • 11
  • 1
0
sudo npm install --global yarn
user16217248
  • 3,119
  • 19
  • 19
  • 37
  • 1
    Welcome to Stack Overflow! While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Aug 28 '23 at 19:20
  • 1
    Please explain why you recommend `-g`, in contrast it seems to `--global` from the existing answer https://stackoverflow.com/a/71461477/7733418 Or is there another functional difference which I missed? – Yunnosch Aug 28 '23 at 22:32