【发布时间】:2020-03-20 12:32:32
【问题描述】:
我已经设置并运行了这个项目https://github.com/achowba/node-mysql-crud-app。它工作正常,但在更改任何未反映在前端的文件后,前端输出始终与以前相同。
nodemon app.js时显示以下输出
C:\xampp\htdocs\node-mysql-crud-app>nodemon app.js
[nodemon] 2.0.2
[nodemon] reading config .\nodemon.json
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 5896 to restart
[nodemon] ignoring: .\.git/**/* node_modules/**/node_modules
[nodemon] watching dir(s): app.js routes\**\* views\**\*
[nodemon] watching extensions: js,json,ejs
[nodemon] bind restart -> `osascript -e 'display notification "App restarted due to:
'$FILENAME'" with title "nodemon"'`
[nodemon] starting `node app.js`
[nodemon] forking
[nodemon] child pid: 1692
[nodemon] watching 7 files
Server running on port: 2000
Connected to database
我的 nodemon.json 文件
{
"restartable": "rs",
"ignore": [
".git",
"node_modules/**/node_modules"
],
"verbose": true,
"execMap": {
"js": "node"
},
"events": {
"restart": "osascript -e 'display notification \"App restarted due to:\n'$FILENAME'\" with title \"nodemon\"'"
},
"watch": [
"app.js",
"routes/",
"views/"
],
"env": {
"NODE_ENV": "development"
},
"ext": "js,json,ejs"
}
我的目录如下
我也试过supervisor,但同样的问题。硬缓存清除也尝试过,但没有反映。请帮助我现在能做什么
【问题讨论】:
-
你改了哪个文件??
-
@SaadSohail 几乎我为测试更改的每个文件,没有反射
-
它工作正常文件正在为我渲染!!!我已经对 sql 进行了更改,它正在工作
-
@SaadSohail 即使我已经清空了 app.js 文件并尝试再次运行 nodemon 但没有效果
-
对 mysql 变量进行了更改,添加您的 sql 数据库名称然后它就可以工作了