I setup some scripts in package.json as follows:
"scripts": {
"dev:server": "nodemon --watch build --exec \"node build/bundle.js\"",
"dev:build:server": "webpack --config webpack.server.js --watch"
},
but I get the following error when I run npm run dev:server
[nodemon] 1.12.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: C:\Users\adinu\Documents\Dev\React Training Code\Udemy\Code\server\build/**/*
[nodemon] starting `node build/bundle.js`
'\"node build\bundle.js\"' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...
If I run node build/bundle.js directly from the terminal, I get no errors.
I also checked the standard things like making sure nodejs is in the path, re-started the machine etc.
Thanks
Alex
To make sure it works in windows, use the script as follows: remove the \" ... \" code around.
"scripts": {
"dev:server": "nodemon --watch build --exec node build/bundle.js",
"dev:build:server": "webpack --config webpack.server.js --watch"
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With