1.安装 npm install --global nodemon 2.使用 nodemon xx 只要是通过` nodemon app.js `启动的服务,则它会监视文件的变化,当文件发生变化的时候,自动帮你重启服务器。