Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Grunt自动重新加载不适用于节点js_Javascript_Node.js_Gruntjs_Grunt Contrib Watch - Fatal编程技术网

Javascript Grunt自动重新加载不适用于节点js

Javascript Grunt自动重新加载不适用于节点js,javascript,node.js,gruntjs,grunt-contrib-watch,Javascript,Node.js,Gruntjs,Grunt Contrib Watch,My app.js文件代码(节点js) 我的Grunfile.js module.exports = function (grunt) { grunt.initConfig({ reload: { port: '8000', proxy: { host: 'localhost' } }, watch:{ files:['index.html'], tasks:['re

My app.js文件代码(节点js)

我的Grunfile.js

module.exports = function (grunt) {

grunt.initConfig({
    reload: {
        port: '8000',
        proxy: {
            host: 'localhost'
        }
    },
    watch:{
        files:['index.html'],
        tasks:['reload']
    }

});

grunt.loadNpmTasks('grunt-reload');

grunt.registerTask('default', ['reload']);

};
当节点处于命令grunt giv错误时

代理[//localhost:80/] 重新加载在[//localhost:8000]上运行的服务器 致命错误:请使用侦听器

当节点关闭Grund命令时

运行“重新加载”任务 代理[//localhost:80/] 重新加载在[//localhost:8000]上运行的服务器

完成,没有错误

但文件不能重新加载

module.exports = function (grunt) {

grunt.initConfig({
    reload: {
        port: '8000',
        proxy: {
            host: 'localhost'
        }
    },
    watch:{
        files:['index.html'],
        tasks:['reload']
    }

});

grunt.loadNpmTasks('grunt-reload');

grunt.registerTask('default', ['reload']);

};