Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k 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 Answer

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...