0

npm start工作正常,但是当我尝试构建时npm run build,编译失败并出现此错误

Creating an optimized production build...
Failed to compile.

The 'compilation' argument must be an instance of Compilation

包.json

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@nivo/radar": "^0.62.0",
    "@stripe/react-stripe-js": "^1.7.0",
    "@stripe/stripe-js": "^1.22.0",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "@types/jest": "^24.9.1",
    "@types/node": "^12.12.47",
    "@types/react": "16.9.23",
    "@types/react-bootstrap": "^0.32.28",
    "@types/react-dom": "16.9.8",
    "@types/react-router-dom": "^5.1.5",
    "@types/uuid": "^8.0.0",
    "antd": "^4.4.0",
    "availity-reactstrap-validation": "^2.7.1",
    "awesome-typescript-loader": "^5.2.1",
    "axios": "^0.19.2",
    "bootstrap": "^5.1.3",
    "classnames": "^2.2.6",
    "customize-cra": "^1.0.0",
    "feather-icons-react": "^0.4.3",
    "js-cookie": "^2.2.1",
    "less": "^3.11.3",
    "less-loader": "^6.2.0",
    "lodash": "^4.17.20",
    "mini-css-extract-plugin": "^2.4.5",
    "mobx": "^5.15.4",
    "mobx-react": "^6.2.2",
    "mobx-react-lite": "^2.0.7",
    "moment": "^2.27.0",
    "react": "16.13.1",
    "react-app-rewired": "^2.1.6",
    "react-countup": "^4.3.3",
    "react-device-detect": "^1.13.1",
    "react-dom": "16.13.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^3.4.0",
    "react-svg": "^11.0.29",
    "reactstrap": "^9.0.1",
    "recharts": "^1.8.5",
    "sass": "^1.45.0",
    "source-map-loader": "^3.0.0",
    "tar": "^6.1.11",
    "typescript": "^3.7.5",
    "uuid": "^8.2.0"
  },
  "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^3.5.0",
    "@typescript-eslint/parser": "^3.5.0",
    "babel-plugin-import": "^1.13.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-config-react": "^1.1.7",
    "eslint-plugin-prettier": "^3.1.4",
    "prettier": "^2.0.5"
  },
  "resolutions": {
    "**/react": "16.9.0",
    "**/react-dom": "16.9.0"
  }
}

我正在使用 Typescript
节点版本:v16.13.1
npm 版本:8.1.2

4

0 回答 0