Create-react-app: `yarn start` fails with error message

Created on 5 Dec 2016  路  12Comments  路  Source: facebook/create-react-app

Description

yarn startfails with below message

yarn start v0.15.1
$ "react-scripts start"
sh: react-scripts start: command not found
error Command failed with exit code 127.
info Visit http://yarnpkg.com/en/docs/cli/start for documentation about this command.

Expected behavior

According to the prompt after creating a project, yarn star should work.

We suggest that you begin by typing:
cd xyz
yarn start
Happy hacking!

Actual behavior

Tell us what actually happens.

Environment

node -v
v7.2.0

npm -v
3.10.9

create-react-app --version                                                                                                                 
create-react-app version: 1.0.0

Operating system: MacOSX 10.12.1

Reproducible Demo

  1. Globally install create-react-app and create one project called xyz.
  2. Follow the prompt instructions;
  3. yarn start fails, but npm start works.
underlying tools

Most helpful comment

worked for me after running just the command yarn in project folder

All 12 comments

I can't reproduce with Yarn 0.17.6.
Can you please run yarn self-update and try again?

Hey @gaearon, I just ran into the same problem. For me, yarn self-update didn' work (as explained here), but I was able to get past that by using npm -g install yarn instead, and it worked as expected after that.

After upgrading yarn to 0.17.10, it turns to be working.

worked for me after running just the command yarn in project folder

It works. Thanks @zverbatim .
For me, accidental npm install --save the package induced the error.

the solution is ..
reset the git
yarn
then yarn add packageName solved the error.

yarn upgrade

I had a similar problem, caused by installing a package using npm instead of yarn, which is what I was using for this project. I got the react script not found error message and the server would not start. To fix it, I ran yarn, then ran yarn start and the server restarted. SUCCESS :)

Well, I know I'm joining the party a bit late... but this was my setup:

  • macOS (High Sierra)
  • I'm using NVM
  • I've installed Yarn using Brew

So, when I stumbled upon this issue the only thing which helped me was:

  1. brew uninstall yarn
  2. rm $(which yarn)
  3. rm -rf ~/.config/yarn

Then,

  • brew install yarn

Hope this helps somebody too

having the same issue, yarn self-update didn't work for me. I ran yarn -v and it printed my version then updated. I was on 0.24.6. It works now.

yarn upgrade

I experiences the yarn start error on 4 different laptops running Ubuntu and resolved it using these steps.
The underlying issue was that the yarn path was set incorrectly.
If you have this error then you will see a yarn-error.log file in you project directory rather then a normal yarn.log file.
But if you reinstall Yarn on Ubuntu, it will also CORRECT Your React * path to yarn and this error.

Here the steps:

1- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
2- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
3- sudo apt-get update && sudo apt-get install yarn
4- sudo apt-get upgrade
- Then Reboot/Restart your System

-- After you did these STEPS, Go To Your Project and BUILD & START Your Yarn:
1. yarn bulid
2. yarn start

Now, after you created a new 'React' Project, you should see the (( yarn.lock )) file in your project folder!

        Then start with:
1.      yarn build
2.      yarn start

I'm facing the same issue "yarn run v1.12.3" but i still get this error
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jnachtigall picture jnachtigall  路  3Comments

Aranir picture Aranir  路  3Comments

alleroux picture alleroux  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

ap13p picture ap13p  路  3Comments