StephenGrider / ReactSSRCasts

Companion Repo to https://www.udemy.com/server-side-rendering-with-react-and-redux
436 stars 369 forks source link

Nodemon build/bundle.js issue on Windows #6

Open leopoldkristjansson opened 6 years ago

leopoldkristjansson commented 6 years ago

I am running windows 8.1 and Node 7.1.0

I was having trouble running:

"dev:server": "nodemon --watch build --exec \"node build/bundle.js\""

until I removed the \" like so:

"dev:server": "nodemon --watch build --exec node build/bundle.js"

The error I got was:

Error

davidhenley commented 6 years ago

Look at your error. You put in an extra backslash

leopoldkristjansson commented 6 years ago

I didn't put anything in there. I just pulled directly from the repo: https://github.com/StephenGrider/ReactSSRCasts/blob/master/server/package.json

milosmijakovac commented 6 years ago

i had that issue myself, when i was building a server .. on command npm run dev:server, it was always rejecting me with that message "[nodemon] app crashed - waiting for file changes before starting". In my case it looked like this:

my package.json was:

"scripts": { "dev:server": "nodemon --watch build --exec node\"build/bundle.js\"", "dev:build:server": "webpack --config webpack.server.js --watch" }, so i just removed those escaping backslashes and everything worked fine.

"scripts": { "dev:server": "nodemon --watch build --exec node build/bundle.js", "dev:build:server": "webpack --config webpack.server.js --watch" }

DenisMartsyniuk commented 6 years ago

Hi

When i write "dev:server": "nodemon --watch build --exec node build/bundle.js",

i have error

$ npm run dev:server

react-ssr@1.0.0 dev:server D:\Git\Nestoria nodemon --watch build --exec node build/bundle.js

[nodemon] 1.12.0 [nodemon] to restart at any time, enter rs [nodemon] watching: D:\Git\Nestoria\build/*/ [nodemon] starting node build/bundle.js events.js:137 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE :::3000 at Object._errnoException (util.js:1003:13) at _exceptionWithHostPort (util.js:1024:20) at Server.setupListenHandle [as _listen2] (net.js:1367:14) at listenInCluster (net.js:1408:12) at Server.listen (net.js:1496:7) at Function.listen (D:\Git\Nestoria\build\bundle.js:7899:24) at Object. (D:\Git\Nestoria\build\bundle.js:7070:5) at __webpack_require__ (D:\Git\Nestoria\build\bundle.js:20:30) at D:\Git\Nestoria\build\bundle.js:63:18 at Object. (D:\Git\Nestoria\build\bundle.js:66:10) [nodemon] app crashed - waiting for file changes before starting...

davidhenley commented 6 years ago

Type killall node

DenisMartsyniuk commented 6 years ago

Yes, I must turn off node build/bundle.js

ctr+C

NangoliJude commented 6 years ago

"dev:server": "nodemon --watch build --exec node build/bundle.js", "dev:build:server": "webpack --config webpack.server.js --watch"