Problem with react-scripts. Does not starting the application. (Dependency issue)

My application was working fine until i updated the react-scripts. After update this error is … Read more Problem with react-scripts. Does not starting the application. (Dependency issue)

My application was working fine until i updated the react-scripts. After update this error is shown to me every time I try to run the application.
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

"babel-jest": "^26.6.0"

Don’t try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:

C:UsersDigital DividendDesktopAccuratoraccuratornode_modulesbabel-jest (version: 27.2.5)

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  1. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
    This may help because npm has known issues with package hoisting which may get resolved in future versions.

  2. Check if C:UsersDigital DividendDesktopAccuratoraccuratornode_modulesbabel-jest is outside your project directory.
    For example, you might have accidentally installed something in your home folder.

  3. Try running npm ls babel-jest in your project folder.
    This will tell you which other package (apart from the expected react-scripts) installed babel-jest.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

 "name": "accurator-web",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@latticehr/react-org-chart": "^0.1.1",
    "@material-ui/core": "^4.12.3",
    "@material-ui/icons": "^4.11.2",
    "animejs": "^3.2.1",
    "axios": "^0.23.0",
    "azure-storage": "^2.10.5",
    "canvg": "^3.0.9",
    "datatables.net": "^1.11.3",
    "dotenv": "^10.0.0",
    "draft-js": "^0.11.7",
    "draftjs-to-html": "^0.9.1",
    "fbemitter": "^3.0.0",
    "floatthead": "^2.2.4",
    "fontawesome-markers": "^4.6.1",
    "formik": "^2.2.9",
    "getstream": "^7.2.11",
    "google-translate-api": "2.3.0",
    "html-to-draftjs": "^1.5.0",
    "immutability-helper": "^3.1.1",
    "jquery": "3.3.1",
    "js-file-download": "^0.4.12",
    "lodash": "^4.17.21",
    "material-table": "^1.69.3",
    "moment": "^2.29.1",
    "nprogress": "^0.2.0",
    "query-string": "^7.0.1",
    "react": "^16.13.1",
    "react-autosuggest": "^10.1.0",
    "react-avatar": "^3.10.0",
    "react-bootstrap": "^1.6.4",
    "react-datepicker": "^4.2.1",
    "react-dom": "^16.13.1",
    "react-draft-wysiwyg": "1.14.1",
    "react-file-drop": "^3.1.2",
    "react-ga": "2.5.3",
    "react-html-parser": "2.0.2",
    "react-intl": "^5.20.13",
    "react-loading": "^2.0.3",
    "react-moment": "^1.1.1",
    "react-notifications": "^1.7.2",
    "react-rating": "^2.0.5",
    "react-rating-stars-component": "^2.2.0",
    "react-router-dom": "4.3.1",
    "react-scripts": "^4.0.3",
    "react-select": "^5.1.0",
    "react-star-ratings": "^2.3.0",
    "react-stepzilla": "^7.0.0",
    "react-toggle": "^4.1.2",
    "react-tooltip": "^4.2.21",
    "react-widgets": "^5.4.0",
    "react-widgets-moment": "^5.0.9",
    "rxjs": "^7.4.0",
    "socket.io-client": "^4.3.2",
    "typescript": "^4.4.4",
    "unstated": "^2.1.1",
    "yup": "^0.32.11"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "extract:messages": "react-intl-cra 'src/**/*.js' -o 'output/messages.json'"
  },
  "proxy": "http://localhost:4000",
  "devDependencies": {
    "globby": "8.0.1",
    "react-intl-cra": "0.3.3"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]

}

Please help me i have wasted 4 hours on it already

Source: React – Stack Overflow



Leave a Reply

Your email address will not be published. Required fields are marked *