Gulp-nodemon监视文件:node:bad选项:-e js,html,hbs

时间:2015-05-26 05:41:00

标签: gulp

我不知道发生了什么,但它不会接受争论。我正在使用节点版本0.12的NVM。你需要的任何其他细节只是大喊。

[07:31:27] Starting 'watch'...
[07:31:30] Finished 'watch' after 3.07 s
[07:31:30] Finished 'dev-local' after 16 s
[07:31:30] [nodemon] v1.3.7
[07:31:30] [nodemon] to restart at any time, enter `rs`
[07:31:30] [nodemon] watching: *.*
[07:31:30] [nodemon] starting `node -e js,html,hbs -w ../dist -w ../dist/public -w ../dist/public/img -w ../dist/public/js -w ../dist/views -w ../dist/routes -w ../dist/partials -w ../dist/layouts --harmony ../dist/app.js`
node: bad option: -e js,html,hbs
[07:31:30] [nodemon] app crashed - waiting for file changes before starting...
[07:31:31] Starting 'reload'...
reload
[07:31:31] index.html reloaded.
[07:31:31] Finished 'reload' after 1.36 ms

这是我的gulpfile.js代码:

gulp.task('nodemon', function () {
    nodemon({
        script: '../dist/app.js',
        nodeArgs: ['-e js,html,hbs', ' -w ../dist -w ../dist/public -w ../dist/public/img -w ../dist/public/js -w ../dist/views -w ../dist/routes -w ../dist/partials -w ../dist/layouts', '--harmony']
    }).on('start', function () {
        setTimeout(function delay() {
            gulp.start('reload');
        }, 400);
    });

    gulp.watch('../dist/**', ['reload']);
});

1 个答案:

答案 0 :(得分:0)

尝试添加execMap配置条目而不是nodeArgs,例如:

"execMap": {
    "js": "node --harmony"
},