Nodemon 不再工作了.用法:nodemon [nodemon 选项] [script.js] [args] [英] Nodemon not working anymore . Usage: nodemon [nodemon options] [script.js] [args]

查看:952
本文介绍了Nodemon 不再工作了.用法:nodemon [nodemon 选项] [script.js] [args]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

nodemon 总是对我有用.我总是做 nodemon server 并且它会运行服务器文件并观察更新并且节点会重新启动.但是现在当我这样做时,我在 cmd 中得到了这个(我使用的是 Windows):

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.

我尝试全局卸载并重新安装 nodemon 但仍然得到反馈.现在我必须在每次更新时使用常规 node 重新启动服务器.

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.

: 这是我输入 dir 并按回车键时的样子

: 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

推荐答案

您确定您的服务器文件在您所在的文件夹中吗?运行 dir 并在运行命令之前确保您期望的文件在目录中.如果您尝试运行的文件不在当前目录中,nodemon 会吐出用法信息.

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.

如果您的文件在目录中,请尝试使用完整的文件扩展名执行 -- nodemon server.js

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

这篇关于Nodemon 不再工作了.用法:nodemon [nodemon 选项] [script.js] [args]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆