Rodrigo Paredes
Rodrigo Paredes

Reputation: 63

How do I add a custom script to my package.json file that runs two commands at the same time?

I need to run 2 commands at the same time:

1)npm start
2)nodemon server.js

the first in

/user/MatildeSalamanca_Project/web-app

and second in

/user/MatildeSalamanca_Project/web-app/src/server

It has to be something like this but with their respective directories

"run": "react-scripts start node server.js"

Upvotes: 2

Views: 138

Answers (1)

DotNetRussell
DotNetRussell

Reputation: 9857

Try using this instead

"run": "cd /user/MatildeSalamanca_Project/web-app && npm start && cd /user/MatildeSalamanca_Project/web-app/src/server && nodemon server.js"

Upvotes: 2

Related Questions