2017-01-27 25 views
1

我在这里堆放着问题gulp.src,这是只接受包含字符串确切的文件像Gulp.src throws'第一个参数必须是字符串,Buffer,ArrayBuffer,Array或类似数组的对象。'

gulp.src('index.html') 

或字符串

gulp.src(['index.html', 'home.html', 'products.html']) 

的阵列,但不能处理

gulp.src('./*.html') 

或 gulp.src(['*。html','./**/*.html']) 这是我的目标。 我总是收到此错误时,我把不同的参数作为从东西前两行:

[15:48:46] Starting 'wiredep'... 
[15:48:46] Finished 'wiredep' after 14 ms 
events.js:160 
    throw er; // Unhandled 'error' event 
^

TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object. 

有人可以让我知道我做错了吗?

回答

4
gulp.src('./*.html') 

gulp.src(['*.html', './**/*.html']) 

是有效的水珠。

也许你的一个.html文件是空的和wiredep插件试图加载一个未定义的流,导致TypeError。

+0

这可能有助于:[gulp-clip-empty-files](https://www.npmjs.com/package/gulp-clip-empty-files) – Alucard

+0

这很有道理。我确信争论是有效的,并且从错误中感到惊讶。我会尝试一下并获得这个线程。谢谢。这个咕嘟声听起来很有用 – Vladyn

+0

这就是问题所在 - 我没有包含标记的bower文件。谢谢 – Vladyn

相关问题