0

npm run both
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> inotebook@0.1.0 both
> concurrently "npm run start" "nodemon backend/index.js"

[1]   Usage: nodemon [nodemon options] [script.js] [args]
[1]
[1]   See "nodemon --help" for more.
[1]
[1] nodemon backend/index.js exited with code 0
[0] npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
[0] npm ERR! code ENOENT
[0] npm ERR! syscall open
[0] npm ERR! path C:\Users\Shakir/package.json
[0] npm ERR! errno -4058
[0] npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Shakir\package.json'
[0] npm ERR! enoent This is related to npm not being able to find a file.
[0] npm ERR! enoent

while trying to run frontend and backend using concurrently i added both script in package.json and when I use the npm run both i am getting error

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "both": "concurrently \"npm run start\" \"nodemon backend/index.js\""
  },

1 Answers1

2

try to use && to launch both

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "both": "npm run start && nodemon './backend/index.js'"
  },

How can I run multiple npm scripts in parallel?