简体   繁体   中英

I'm not able to run the react web project and npm install also not working

I'm getting following errors if npm install在此处输入图像描述

i tried clean cache also like this在此处输入图像描述

if i directly run the project it's shows react it shows "'react-scripts' is not recognized as an internal or external command"

在此处输入图像描述

this is the package.json code used in my project i'm not getting what's the issue bcoz i'm new to react.let me know how to run the project.. thanks in advance..

{
  "name": "pay-management",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/core": "^11.0.0",
    "@emotion/react": "^11.1.5",
    "@fortawesome/fontawesome-svg-core": "^1.2.34",
    "@fortawesome/free-brands-svg-icons": "^5.15.2",
    "@fortawesome/free-solid-svg-icons": "^5.15.2",
    "@fortawesome/react-fontawesome": "^0.1.14",
    "@material-ui/core": "^4.11.1",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "^4.0.0-alpha.57",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "autoprefixer": "7",
    "change-case": "^4.1.1",
    "lodash": "^4.17.21",
    "material-ui": "^0.20.2",
    "material-ui-bootstrap": "^2.0.0",
    "moment": "^2.29.1",
    "postcss": "7",
    "postcss-flexbugs-fixes": "4",
    "postcss-preset-env": "^6.7.0",
    "react": "^17.0.1",
    "react-beautiful-dnd": "^13.0.0",
    "react-csv-importer": "^0.3.0",
    "react-dom": "^17.0.1",
    "react-dropzone": "^11.2.4",
    "react-moment": "^1.1.1",
    "react-number-format": "^4.4.4",
    "react-papaparse": "^3.11.1",
    "react-resize-observer": "^1.1.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.1",
    "react-table": "^7.6.2",
    "react-timer-mixin": "^0.13.4",
    "web-vitals": "^0.2.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "globals": {
    "_": true
  },
  "homepage": "url",
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@tailwindcssinjs/macro": "^0.17.0",
    "cross-env": "^7.0.2",
    "tailwindcss": "^2.0.1-compat"
  },
  "main": "index.js",
  "author": "",
  "license": "ISC"
}

The error message you're seeing trying to run build makes sense. You can't run your build script if you haven't installed the dependencies first - since you don't have the libraries necessary to compile the project yet! npm run build is a synonym for "react-scripts build" according to your package.json file, so you need react (which is part of your dependency list). You have to solve the dependency conflicts first - then you can run build.

The npm dependecy conflict message tells you the steps to follow in order to solve them, read them and follow those. AFTER trying those official steps, if they don't help, as the last resort I would try upgrading manually autoprefixer to be v 10.0.2 ~it appears you installed it manually while developing without knowing tailwind was going to use it internally.

Hope that helps.

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