【问题标题】:nodejs file changes not reflecting even nodemon & supervisornodejs 文件更改甚至没有反映 nodemon 和主管
【发布时间】: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 数据库名称然后它就可以工作了

标签: node.js nodemon


【解决方案1】:

终于解决了。这是netbeans IDE问题。当我在记事本++中编辑然后更改反射但在netbeans中不起作用。不知道为什么 netbenas 不起作用。我已经删除并再次创建了这个项目。之后甚至无法在 netbeans 中为该项目创建新项目

【讨论】:

    猜你喜欢
    • 2020-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 2020-08-08
    • 2018-04-25
    • 1970-01-01
    相关资源
    最近更新 更多