简体   繁体   中英

running 'npm start' compiles my project endlessly

I have a react project set up with a node server backend that needs to start running along with react. In order to do so I'm using the 'concurrently' package, but I have a problem where every time I run 'npm start' it keeps showing the compilation output again and again. It does run but it's overloading my pc.

package.json:

{
  "name": "anarchy-chess",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.8.2",
    "@emotion/styled": "^11.8.1",
    "@headlessui/react": "^1.5.0",
    "@material-ui/core": "^4.12.3",
    "@mui/material": "^5.5.3",
    "@testing-library/jest-dom": "^5.16.3",
    "@testing-library/react": "^12.1.4",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.4.1",
    "@types/node": "^10.1.4",
    "@types/react": "^17.0.43",
    "@types/react-dom": "^17.0.14",
    "bootstrap": "^5.1.3",
    "concurrently": "^7.1.0",
    "express": "^4.17.3",
    "gun": "^0.2020.1236",
    "jquery": "^3.6.0",
    "jquerykeyframes": "^1.0.8",
    "mongodb": "^4.5.0",
    "net": "^1.0.2",
    "npm-run-all": "^4.1.5",
    "react": "^17.0.2",
    "react-bootstrap": "^2.2.2",
    "react-color-square": "^1.0.1",
    "react-dom": "^17.0.2",
    "react-scripts": "5.0.0",
    "rxjs": "^7.5.5",
    "semantic-ui-css": "^2.4.1",
    "semantic-ui-react": "^2.1.2",
    "sizedbox": "^1.0.3",
    "typescript": "^4.6.3",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start-js": "react-scripts start",
    "backend-start": "NODE_ENV=production node server/index.js",
    "start": "concurrently \"npm-run-all -p backend-start start-js\"",
    "build": "npm-run-all build-css && 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": {
    "@babel/plugin-syntax-jsx": "^7.16.7",
    "@babel/preset-react": "^7.16.7",
    "@types/jquery": "^2.0.47",
    "@types/webpack-env": "^1.16.3",
    "webpack": "^5.70.0",
    "webpack-env": "^0.8.0"
  },
  "description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
  "main": "babel.config.js",
  "keywords": [],
  "author": "",
  "license": "ISC"
}

the output:

> anarchy-chess@0.1.0 start
> concurrently "npm-run-all -p backend-start start-js"

[0] 
[0] > anarchy-chess@0.1.0 backend-start
[0] > NODE_ENV=production node server/index.js
[0] 
[0] 
[0] > anarchy-chess@0.1.0 start-js
[0] > react-scripts start
[0] 
[0] Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!
[0] Example app listening at http://localhost:3030
[0] (node:142152) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
[0] (Use `node --trace-deprecation ...` to show where the warning was created)
[0] (node:142152) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
[0] Starting the development server...

and then every few seconds:

[0] Compiled with warnings.
[0] 
[0] Critical dependency: the request of a dependency is an expression
[0] 
[0] Search for the keywords to learn more about each warning.
[0] To ignore, add // eslint-disable-next-line to the line before.
[0] 
[0] assets by path static/media/*.png 197 KiB
[0]   asset static/media/black_king.9e14542fd5a109ab76eb.png 30.5 KiB [emitted] [immutable] [from: src/assets/piece_icons/black_king.png] (auxiliary name: main)
[0]   asset static/media/white_queen.78c2218b306dbe920e2e.png 27.8 KiB [emitted] [immutable] [from: src/assets/piece_icons/white_queen.png] (auxiliary name: main)
[0]   asset static/media/white_king.0b12ef64bb15ea2e6fe8.png 26.8 KiB [emitted] [immutable] [from: src/assets/piece_icons/white_king.png] (auxiliary name: main)
[0]   asset static/media/black_queen.ea62f63e31395056f95d.png 22.9 KiB [emitted] [immutable] [from: src/assets/piece_icons/black_queen.png] (auxiliary name: main)
[0]   asset static/media/white_knight.4658ef8cbd71b4574b87.png 19.8 KiB [emitted] [immutable] [from: src/assets/piece_icons/white_knight.png] (auxiliary name: main)
[0]   asset static/media/white_bishop.94f2759131472f83b872.png 17.4 KiB [emitted] [immutable] [from: src/assets/piece_icons/white_bishop.png] (auxiliary name: main)
[0]   asset static/media/black_knight.95260ce9907e8698a558.png 16.2 KiB [emitted] [immutable] [from: src/assets/piece_icons/black_knight.png] (auxiliary name: main)
[0]   asset static/media/white_pawn.739079b2de273a12f8cf.png 12.7 KiB [emitted] [immutable] [from: src/assets/piece_icons/white_pawn.png] (auxiliary name: main)
[0]   asset static/media/black_bishop.3c76932779a3252ee860.png 11.8 KiB [emitted] [immutable] [from: src/assets/piece_icons/black_bishop.png] (auxiliary name: main)
[0]   asset static/media/capture_icon.19f1497c21b106b9cf54.png 11.1 KiB [emitted] [immutable] [from: src/assets/action_icons/capture_icon.png] (auxiliary name: main)
[0] asset static/js/bundle.js 2.16 MiB [emitted] (name: main) 1 related asset
[0] asset index.html 1.67 KiB [emitted]
[0] asset asset-manifest.json 1.07 KiB [emitted]
[0] cached modules 2.34 MiB (javascript) 197 KiB (asset) [cached] 467 modules
[0] runtime modules 29.4 KiB 15 modules
[0] ./src/client_side/client_flow_engine.ts 4.52 KiB [built] [code generated]
[0] 
[0] WARNING in ./node_modules/gun/gun.js 6:17-29
[0] Critical dependency: the request of a dependency is an expression
[0]  @ ./node_modules/gun/browser.js 1:0-36
[0]  @ ./src/server_side/game_server.ts 5:0-22 34:17-20
[0]  @ ./src/server_side/server_flow_engine.ts 3:0-91 11:26-36 57:11-46 65:11-46 68:51-85 68:109-136
[0]  @ ./src/App.tsx 9:0-68 14:29-45
[0]  @ ./src/index.tsx 7:0-24 10:33-36
[0] 
[0] 1 warning has detailed information that is not shown.
[0] Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
[0] 
[0] webpack 5.70.0 compiled with 1 warning in 26344 ms
[0] No issues found.
[0] Compiling...

delete node modules folder and do 'npm install' again, Then, 'npm 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