DEV Community

Discussion on: Run React-Frontend and Nodejs-Backend with one command

Collapse
 
hafizsaifullah profile image
Hafiz Saifullah

I am using express server for back-end and react for front-end. my instructor, in video use script as follow in package.json
"dev": "npm run dev-client & nodemon index.js"
when he run on terminal the following command
npm run dev
both terminals run with this command, but when i try to use following pattern, only the front end run...

Collapse
 
0xkoji profile image
0xkoji

"dev": "npm run dev-client & nodemon index.js"

It should be "dev": "npm run dev-client && nodemon index.js".

Collapse
 
hafizsaifullah profile image
Hafiz Saifullah

It also was not working but for now Issue has been resolved by installing concurrently using
npm i concurrently --save
and changing dev script by
"dev": "concurrently \"npm run dev-client\" \"nodemon index.js\""

Thanx a lot for your kind response, that is a lot for me.
Thank you @koji

Thread Thread
 
0xkoji profile image
0xkoji

Nice!