2

I am trying to run a reactnative application. I have updated the npm along with its package dependencies. With the following series of command

npm install

Followed by

npm update

Then

npm install -g yarn

Then i tried to run yarn as yarn start

Even after all the updates it says yarn is not recognized. But when install a fresh reacnative app as per its documentation and run yarn it works, but not working with this reactnative project.

I am using react native "0.55.3"

I looked over SO and found this thread which has same issue as me. but those answers does not work for me . React Native Error - yarn' is not recognized as an internal or external command

if anyone can help i will really appreciate that. Thanks

user7747472
  • 1,874
  • 6
  • 36
  • 80

3 Answers3

1

Are you sure the error is related to yarn itself? What's your exact error?

You might try installing yarn from their website and restarting your computer just to ensure your commandline knows where it is.

Noah Allen
  • 699
  • 5
  • 14
  • apparently seems that install with npm didn't work. When i install the msi from the link you gave it worked :) Thank you so much. I thought it was an issue reactnative – user7747472 Apr 26 '18 at 15:02
1

Check path at environment variables, If it's not there add it manually.

The installation prompt shows that where it was installed.

In my case Its,

path : C:\Users<User name>\AppData\Roaming\npm\yarn\bin

Adding the Path manually solved my issue. (Reopen the command prompt after setting the path)

Or

The problem may be the one extra "\" was missing after the bin in your path.

Go to Environment Variables and change the path as follows

With error : C:\Program Files (x86)\Yarn\bin (Not working)

solved : C:\Program Files (x86)\Yarn\bin\ (Working)

0

On linux restarting the terminal helped me.

KhairulBashar
  • 141
  • 1
  • 9