简体   繁体   中英

yarn start - command “start” not found

yarn start leads to an error saying command "start" not found. In my package.json file there is no script's tag, could that be the issue. Please suggest a fix.

I am trying to install react, the commands being:

npm install -g create-react-app@1.5.2
create-react-app confusion
yarn start

cmd error: command prompt

package.json:

  "name": "confusion",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.1"
  }
}
  1. npm uninstall -g create-react-app // uninstall the old create-react-app version (in your case, v1.5.2) to make sure npx uses the latest version in Step 2
  2. npx create-react-app my-react-app-name // npx installs the latest version of create-react-app without requiring a global install. it is included with npm, so no need to install it. if you wish, replace my-react-app-name with whatever you want your project to be called
  3. cd my-react-app-name
  4. yarn start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM