1、在项目中安装nodemon依赖。 npm i nodemon -D 2、package.json中script中的start命令修改如下: nodemon --exec electron . --watch ./ --ext .js,.html 之前尝试过elec