1

I have a package.json file at the root of my project folder which contains client and server folders. in the root package.json I have the following scripts:

"scripts": {
    "server": "npm run watch --prefix server",
    "client": "npm start --prefix client",
    "watch": "npm run server & npm run client"
  }

but when i try to run npm run watch only the server script runs, what I don't understand is if I paste the contents of the watch script into the terminal it works just fine.

1 Answers1

0

npm run <script> uses cmd.exe by default if you are on windows, and cmd does not support & to run commands in parallel, so it is better to use a package like npm-run-all.