npm start同时执行两个命令的办法

需要安装 concurrently 模块

npm install concurrently

package.json修改如下

"scripts": {

    "test": "echo \"Error: no test specified\" && exit 1",

    "clientServer": "live-server --open=./client/index.html",

    "server": "node ./server/express.server.js",

    "start": "concurrently \"npm run clientServer\" \"npm run server\" "

},

npm start 会同时执行 clientServer 和 server两个命令

 

 

你可能感兴趣的:(npm,package.json)