-3

scripts in package.json

"scripts": {
    "start": "node back-end/server.js",
    "server": "nodemon back-end/server.js",
    "client": "npm start --prefix front-end",
    "dev": "concurrently \"npm run server\" \"npm run client\"",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

whenever I run the code using concurrently it shows me error like this

$ npm run dev

> concurrently "npm run server" "npm run client"

[0] Error occurred when executing command: npm run server
[0] Error: spawn cmd.exe ENOENT
[0]     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
[0]     at onErrorNT (node:internal/child_process:480:16)
[0]     at processTicksAndRejections (node:internal/process/task_queues:81:21)
[1] Error occurred when executing command: npm run client
[1] Error: spawn cmd.exe ENOENT
[1]     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
[1]     at onErrorNT (node:internal/child_process:480:16)
[1]     at processTicksAndRejections (node:internal/process/task_queues:81:21)
[1] npm run client exited with code -4058
[0] npm run server exited with code -4058 ```
BAJI SHAIK
  • 11
  • 1
  • 2

1 Answers1

-1

Try by replacing "dev": "concurrently \"npm run server\" \"npm run client\"", with

"dev": "npm run server && npm run client",
brk
  • 48,835
  • 10
  • 56
  • 78