nodemon not working properly

后端 未结 13 1269
我在风中等你
我在风中等你 2021-02-01 05:20

I am running my nodejs app by npm start

I just installed nodemon by sudo npm install -g nodemon so that i can get my server restarted when i s

13条回答
  •  星月不相逢
    2021-02-01 05:28

    You're running express 4, which has the app.listen call in a different file than app.js. The command you're looking for is nodemon bin/www (localhost and 3000 are not needed in this scenario).

    In fact, you can even run nodemon with no args, and it'll read what command needs to be run from scripts.start in package.json (which express generates automatically).

提交回复
热议问题