javascript - nodemon 启动无限的 .node-xmlhttprequest-sync 文件

标签 javascript node.js nodemon

我有一个应用程序导入一个有 promise 的模块。

当我使用“node app.js”启动它时,它工作正常

但是,当我启动“nodemon”时,它会不断创建文件 .node-xmlhttprequest-sync-1516(最后是随机数)

有人遇到过这个问题吗?在谷歌上找不到任何答案...非常感谢!

nodemon
[nodemon] 1.17.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:38.409
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:0.615
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:0.661
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:0.593
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:0.59
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:0.603
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
app running on port 3100
app running on port 8080
secs:0.597
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
^CTerminate batch job (Y/N)? y

最佳答案

您正在监视 *.* 上的更改。您的服务器可能在某个时刻写入一个文件,这导致服务器重新启动,并且这种情况会一遍又一遍地发生。查看docs关于如何忽略某些文件/文件夹

关于javascript - nodemon 启动无限的 .node-xmlhttprequest-sync 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49773882/

相关文章:

带有 babel-node 的 nodemon 在终端崩溃但服务器运行正常?

node.js - nodemon + express,监听端口=?

javascript - 错误 [ERR_MODULE_NOT_FOUND] : Cannot find package 'express' imported from F:\Document\My Project\NODE JS\Sample 1\tinder-backend\server. js

javascript - afterCreate 数据库 Hook 进程准备就绪后如何向客户端发送消息?

javascript - 通过 HTTP 请求向 gmail 帐户添加过滤器?

javascript - ExpressJS 中的 POST 请求问题

node.js - 如何将表单数据中的缓冲区发送到 SignServer?

node.js - 团结 : Live video streaming

click - javascript禁用边框半径点击事件

循环内的 JavaScript 闭包——简单实用的例子