Nodemon not working anymore . Usage: nodemon [nodemon options] [script.js] [args]

蹲街弑〆低调 提交于 2021-01-27 05:22:31

问题


nodemon always worked for me. I always did nodemon server and it would run the server file and watch for updates and node would restart. But now when I do it, I get this in the cmd (I use windows):

Usage: nodemon [nodemon options] [script.js] [args]

See "nodemon --help" for more.

I tried uninstalling and reinstalling nodemon globally but still get the feedback. now I have to restart the server with regular node on every update.

EDIT:: This is what it looke like when i type in dir and press enter

05/29/2016  05:55 PM    <DIR>          .
05/29/2016  05:55 PM    <DIR>          ..
05/29/2016  05:35 AM    <DIR>          node_modules
05/29/2016  02:20 PM    <DIR>          public
05/24/2016  09:30 PM             2,836 server.js
05/29/2016  12:05 AM             3,513 server2.js
05/30/2016  12:41 AM             3,651 server3.js
05/29/2016  05:55 PM    <DIR>          views
               3 File(s)         10,000 bytes
               5 Dir(s)  650,802,348,032 bytes free

回答1:


Are you sure your server file is in the folder you are in? Run dir and make sure the file you expect is in the directory before running the command. If the file you are trying to run is not present in the current directory, nodemon will spit out the usage message.

If your file is in the directory, try executing with the full file extension -- nodemon server.js



来源:https://stackoverflow.com/questions/37536734/nodemon-not-working-anymore-usage-nodemon-nodemon-options-script-js-args

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!