verekia / js-stack-from-scratch

🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
MIT License
20.09k stars 1.99k forks source link

dev:start not working with npm #182

Closed oolong32 closed 7 years ago

oolong32 commented 7 years ago

Refers to chapter ‘Nodemon’

Abstracting the start script (from start to dev:start) seems not to work when using npm instead of yarn. I only got the start script to work when I removed the save-dev line and put everything back into ‘start’:

"start": "nodemon --ignore lib --exec babel-node src/server",
verekia commented 7 years ago

It's because NPM needs npm run blabla where Yarn only needs yarn blabla. If you want to use NPM, add run everywhere.

oolong32 commented 7 years ago

Thanks.

"start": "npm run start:dev",
"start:dev": "nodemon --ignore lib --exec babel-node src/server",

This works indeed.

And by the way, this tutorial is exceptionally well done. Thank you again.

verekia commented 7 years ago

You're very welcome :)