1、安装superior

npm -g install supervisor

注意 superior必须全局安装,否则错误命令会提示安装到全局

2、修改启动

现在我们需要使用 supervisor app.js 来启动程序,而不是使用node app.js来启动程序

 把 package.json 的 "start": "node ./bin/www"  修改为 "start": "supervisor ./bin/www"

 如下所示:

"scripts": {
    "start": "node ./bin/www"
  },

修改为
  "scripts": {
    "start": "supervisor ./bin/www"
  },

 

3、使用npm start来启动系统

访问http://localhost:3000即可


相关文章:

  • 2021-11-20
  • 2021-06-29
  • 2021-11-01
  • 2021-09-12
  • 2022-01-17
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-02-13
  • 2022-12-23
相关资源
相似解决方案