Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

reactjs - Error: yarn start - error Command "start" not found

I am trying to learn React and I am using a private repo to start with it.

I run yarn start in the directory of the repo but I get the error message:

yarn run v1.13.0
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have both node and yarn installed.

For node:

v10.15.0
node is /usr/local/bin/node

For yarn:

1.13.0
yarn is /usr/local/bin/yarn

I tried to reinstall both node and yarn but I get the same error message. moreover I tried to remove the yarn chance via yarn cache clean but nothing seems to work.

The package.json contains the following:

{
  "name": "02-Manipulating-Strings",
  "version": "1.0.0",
  "author": "ssaunier",
  "license": "UNLICENSED",
  "private": true,
  "devDependencies": {
    "eslint": "^4.7.2",
    "eslint-config-airbnb-base": "^12.0.0",
    "eslint-plugin-import": "^2.7.0",
    "jest": "^21.1.0"
  },
  "scripts": {
    "test": "(eslint lib || true) && jest"
  }
}

The directory is organised in the following way:

project directory

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is no start command inside the scripts of the package.json file.

"scripts": {
  "start": "some command to be run", // you need to add this line
  "test": "(eslint lib || true) && jest"
}

Maybe you want to run the test command instead - npm test / yarn test?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...