简体   繁体   中英

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. nodemon doesn't work, it just shows output in terminal as [nodemon] restarting due to changes.. but not "actually" refreshing.

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.

I am fetching data from MongoDB and have used mongoose.

app.js works perfect when I stop nodemon by CTRL+C and npm start , but not hot reloading.

is this problem of my template 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".

That should do the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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