最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Gulp.src throws 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.&#39

programmeradmin2浏览0评论

I'm stacked here with problem with gulp.src, which is only accepts String containing exact file like

gulp.src('index.html') 

or array of strings

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

but can't handle

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

or gulp.src(['*.html', './**/*.html']) which is I'm aiming to. I'm always getting this error is I put something different as argument from the first two line:

[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.

Can somebody let me know what I'm doing wrong?

I'm stacked here with problem with gulp.src, which is only accepts String containing exact file like

gulp.src('index.html') 

or array of strings

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

but can't handle

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

or gulp.src(['*.html', './**/*.html']) which is I'm aiming to. I'm always getting this error is I put something different as argument from the first two line:

[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.

Can somebody let me know what I'm doing wrong?

Share Improve this question asked Jan 27, 2017 at 14:57 VladynVladyn 5831 gold badge6 silver badges20 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6
gulp.src('./*.html')

and

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

are valid globs.

Maybe one of your .html file is empty and the wiredep plugin tries to load an undefined stream which causes the TypeError.

发布评论

评论列表(0)

  1. 暂无评论