简体   繁体   English

在Windows 10中的node.js中运行时,index.pug文件视图中的更改不会重新加载实时或使用nodemon刷新后

[英]changes in views of index.pug file are not reloading live or after refresh using nodemon while running in node.js in Windows 10

I searched this issue but this answer did not solve my problem. 我搜索了此问题,但是此答案无法解决我的问题。

whenever I make changes in app.js, then they don't seen in browser. 每当我在app.js中进行更改时,它们都不会在浏览器中看到。 nodemon doesn't work, it just shows output in terminal as [nodemon] restarting due to changes.. but not "actually" refreshing. nodemon不起作用,它只是在终端显示输出,因为[nodemon] restarting due to changes..[nodemon] restarting due to changes..但不是“实际上”刷新。

I start my app.js using npm start and start script is "start": "nodemon -e js, pug" , even when I manually run nodemon app.js then only it doesnot refreshes automatically and dynamically. 我使用npm start启动我的app.js,并且启动脚本是"start": "nodemon -e js, pug" ,即使当我手动运行nodemon app.js时,也只有它不会自动和动态刷新。

I am fetching data from MongoDB and have used mongoose. 我正在从MongoDB提取数据,并使用过猫鼬。

app.js works perfect when I stop nodemon by CTRL+C and npm start , but not hot reloading. 当我通过CTRL+Cnpm start停止nodemon而不是热重装时,app.js可以完美地工作。

is this problem of my template engine-pug.js? 我的模板engine-pug.js是这个问题吗?

Drop the space, you should run nodemon -e js,pug as nodemon is parsing the arguments using spaces, so it's seeing the extensions as "js" and not "js and pug". 删除空间,您应该运行nodemon -e js,pug因为nodemon使用空格来解析参数,因此它将扩展名视为“ js”,而不是“ js and pug”。

That should do the trick. 这应该够了吧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM