linux - Nodemon + 永远不检测文件更改

标签 linux node.js ubuntu-14.04 forever nodemon

我有以下命令:

/usr/local/bin/forever start -o /home/username/path/out.log -e /home/username/path/err.log /usr/local/bin/nodemon --watch /home/username/scriptpath --exitcrash /home/username/scriptpath/example.js

我理解应该:

  • 作为守护进程永远运行
  • 运行 Nodemon,当/home/username/scriptpath 中发现更改时,它将重新启动脚本,并且还会在崩溃时永远“退出”,从而永远重新启动所有脚本。

但是,我观察到 Nodemon 在监视文件夹中的文件发生更改时没有重新启动。 (虽然永远是在崩溃时重新启动,但当我故意造成崩溃时。)

注意:仅运行“nodemon example.js”按预期工作,并在文件更改后重新启动。

我需要更改什么才能允许 Nodemon 在文件更改后重新启动脚本?

不幸的是,我对 Linux 命令的了解有限,我很可能使用了错误的命令。

最佳答案

它只会监视 require 所运行的脚本喜欢的文件中的更改。

例如:永远./script.js ...

var x = require("./test")

如果 ./test 更改,将重新启动 ./script。

关于linux - Nodemon + 永远不检测文件更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25807397/

相关文章:

node.js - 如何在 Electron 中显示 RTSP 流?

linux - Ubuntu 14 和 Linux Mint 17 上的隧道问题

linux - Git 不会通过 cifs mount 重置文件权限

linux - tm 和 Snowball 软件包命令在 Linux 中运行缓慢

node.js - nodejs - 将流从工作线程发送回主线程

php - 如何在 ubuntu 14.04 上设置多个 PHP-FPM master?

php - 软件包 libapache2-mod-auth-mysql 不可用

node.js - 尝试让 Node Express 应用程序运行

localhost - 在 Ubuntu 14.04 上使用 Postfix 设置 postmaster

bash - 如何在 Sudo chown root -R/usr 之后修复权限