Giter Club home page Giter Club logo

Comments (8)

khushahal-sharma avatar khushahal-sharma commented on August 20, 2024 3

hi @VerteDinde i am trying same your way but node and react together not working. only express starts but react not here is my code
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"dev":"node src/Backend/Server.js & npm start"
},

command : npm run dev
output : Express server listning on port no 5000
and react is not starting

from express-react-starter.

burkeholland avatar burkeholland commented on August 20, 2024 2

Thanks to @auchenberg and others, we now have a launch configuration for VS Code that will launch both processes through the editor.

from express-react-starter.

Avonavi232 avatar Avonavi232 commented on August 20, 2024 1

@khushahal-sharma
Had the same problem. Solved using parallelshell package:
"scripts": { "start": "parallelshell \"node server/server\" \"react-app-rewired start\"", ... },
But, notice that I`m using react-app-rewired

from express-react-starter.

OhNaNaSun avatar OhNaNaSun commented on August 20, 2024 1

@khushahal-sharma I solved this using concurrently, it works well.
"start": "concurrently \"yarn mock:api\" \"yarn start-react\""

from express-react-starter.

burkeholland avatar burkeholland commented on August 20, 2024

I like that! It works well. One of the reasons I've been holding off on providing a better run experience is that whatever that I experience is, I want it to "just work" with VS Code. I want to be able to ship an experience that you can fire up from the terminal, or you can just hit the little green arrow in VS Code.

I've been following this issue which attempts to address the running of an npm command as a build configuration in VS Code. However, VS Code seems to choke on running two different processes like you suggested above.

Any thoughts there?

from express-react-starter.

auchenberg avatar auchenberg commented on August 20, 2024

I ended up doing something similar in my demo app thats using create-react-app + express: https://github.com/auchenberg/timey/blob/master/package.json#L13

from express-react-starter.

IvRRimum avatar IvRRimum commented on August 20, 2024

You can just use foreman for that. Really easy dev too for these kind's of situations.

from express-react-starter.

khushahal-sharma avatar khushahal-sharma commented on August 20, 2024

can you please explain requirement of 2 package.json files one in root structure and another in /server folder any one please @VerteDinde @burkeholland @auchenberg @IvRRimum

from express-react-starter.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.