我試圖運行此之後一飲而盡,我在jekkyl模板中找到。 我在Windows 8.1上的節點4上運行,我不理解爲什麼每次我得到的:咕嘟咕嘟不工作
events.js:141
throw er; //Unhandled 'error' event
^
給我的感覺就是與Windows的東西,因爲當我跑在Linux上我沒有問題。
這是一飲而盡:
gulp.task('jekyll-build', function (done) {
browserSync.notify(messages.jekyllBuild);
return cp.spawn('jekyll', ['build'], {stdio: 'inherit'})
.on('close', done);
});
gulp.task('jekyll-rebuild', ['jekyll-build'], function() {
browserSync.reload();
});
gulp.task('browser-sync', ['jekyll-build'], function() {
browserSync({
server: {
baseDir: '_site'
}
});
});
gulp.task('stylus', function(){
gulp.src('src/styl/main.styl')
.pipe(plumber())
.pipe(stylus({
use:[koutoSwiss(), prefixer(), jeet(),rupture()],
compress: true
}))
.pipe(gulp.dest('_site/assets/css/'))
.pipe(browserSync.reload({stream:true}))
.pipe(gulp.dest('assets/css'))
});
gulp.task('js', function(){
return gulp.src('src/js/**/*.js')
.pipe(plumber())
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('assets/js/'))
});
gulp.task('imagemin', function() {
return gulp.src('src/img/**/*.{jpg,png,gif}')
.pipe(plumber())
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest('assets/img/'));
});
gulp.task('watch', function() {
gulp.watch('src/styl/**/*.styl', ['stylus']);
gulp.watch('src/js/**/*.js', ['js']);
gulp.watch('src/img/**/*.{jpg,png,gif}', ['imagemin']);
gulp.watch(['*.html', '_includes/*.html', '_layouts/*.html', '_posts/*'], ['jekyll-rebuild']);
});
gulp.task('default', ['js', 'stylus', 'browser-sync', 'watch']);
有誰知道爲什麼和能幫助我理解?
您應該添加一些關於您所看到的錯誤的更多詳細信息,如果您可以粘貼整個錯誤消息,可能會有更多信息。 –