Home > Mobile >  yarn start doesn't open react app on chrome but no errors are thrown?
yarn start doesn't open react app on chrome but no errors are thrown?

Time:08-15

I have a simple react app that I started recently just to study a few things and suddenly, when I try to run it with:

yarn start

it does not throws any error, just stays like this:

yarn run v1.22.19
warning ..\package.json: No license field
$ react-scripts start

and nothing happens, what should i do?

PS: my complete package.json:

    {
  "name": "prototype",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^13.0.0",
    "@testing-library/user-event": "^13.2.1",
    "framer-motion": "^7.1.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.3.0",
    "react-scripts": "^5.0.1",
    "start": "^5.1.0",
    "styled-components": "^5.3.5",
    "web-vitals": "^2.1.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "eslint": "^8.21.0"
  }
}

CodePudding user response:

As you can see in the error message the path of the package.json file is in the warning:

yarn run v1.22.19
warning ..\package.json: No license field
$ react-scripts start

That double dots ..\ saying that the package.json file is one folder up from where you are running the yarn start command. It could be OUTSIDE the project folder you're working on.

So if you go one directory up you will find another package.json file. Either add "license" field into that package.json file or simply delete the file if you do not need it.

This should solve your problem.

  • Related