When scripts is set in npm package.json, multiple instructions cannot be executed at the same time

set as follows

"scripts": {
  "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
  "build": "node build/build.js",
  "analyz": "set NODE_ENV=production && set npm_config_report=true && npm run build",
  "start-api": "nodemon server/index.js",
  "start": "npm run start-api && npm run dev"
  },

but after running npm start , only the previous instruction was executed, and the latter instruction was not executed.
but several of its instructions are completed after running npm run analyz . I"m puzzled. =

Mar.16,2021

& & is to wait until the previous command has been executed and no error has been reported (return 0) before returning the last instruction. I think your start-api command will probably not be executed for a long time, so it will not be executed


I would like to ask whether this problem has been solved? Encountered the same problem

Menu