【问题标题】:Nodemon giving an issueNodemon 给出一个问题
【发布时间】:2021-11-11 06:17:38
【问题描述】:
  1. 我安装了nodemon
  2. 我对代码进行了更改。
  3. 由于更改而卡在正在重新启动,并且不会重新启动服务器。

为什么会发生这种情况以及如何解决?

>>index.js
const express = require('express');

const app = express();

app.get('', (req, res) => {
    res.send('Hello, world!');
})

app.get('./help', (req, res) => {
    res.send('Help Page!');
})

const port = 3000;
// const hostName = '127.0.0.1';

app.listen(port, () => {
    console.log(`Server is listening on ${port}`);
});



>>package.json
{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "nodemon index.js"
  },
  "author": "Sharjeel",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1",
    "nodemon": "^2.0.12"
  }
}

【问题讨论】:

    标签: node.js node-modules nodemon


    【解决方案1】:

    问题出在最新版本的 nodemon 上。以前或旧版本运行完全正常,没有任何问题,即 nodemon@2.0.7。

    【讨论】:

      猜你喜欢
      • 2019-01-31
      • 1970-01-01
      • 2021-11-08
      • 2013-09-19
      • 2021-05-28
      • 2017-07-08
      • 2018-01-14
      • 2020-02-02
      • 2011-07-15
      相关资源
      最近更新 更多