Auto-starting Node.js application on Vagrant when there are changes to code

前端 未结 2 373
余生分开走
余生分开走 2021-01-03 12:23

I\'m running a Node.js application on a Vagrant box and want the Node.js application to restart when anything changes on the host machine.

But I couldn\'t use nodemo

2条回答
  •  旧巷少年郎
    2021-01-03 13:18

    Ates' answer provides quite a bit of bloat in my opinion (pm2, Gulp, gulp-shell and an excessive gulpfile?!). A great alternative to nodemon is a similar lib called node-dev. It's also mentioned under nodemon's issues with Vagrant (which you skimmed through, I imagine).

    Basic usage:

    node-dev --no-deps app.js
    

    All the best :)

提交回复
热议问题