gulp之clean引起的错误。
项目构建时,这样构建时是正常的。
gulp.task('dev', ['copy'], function(){
return gulp.start('htmlRev');
});
多了clean步骤时,如下:
var dist = './src/main/webapp';
gulp.task('dev', ['clean', 'copy'], function(){
return gulp.start('htmlRev');
});
gulp.task('clean', function() {
return gulp.src(dist, {read: false})
.pipe(plumber())
.pipe(clean());
});
报错了,为什么?
D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.2.6.1@rimraf\rimraf.js:61
if (options.disableGlob || !glob.hasMagic(p))
^
TypeError: glob.hasMagic is not a function
at rimraf (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.2.6.1@rimraf\rimraf.js:61:36)
at Transform._transform (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.0.3.2@gulp-clean\index.js:16:7)
at Transform._read (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:184:10)
at Transform._write (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:172:12)
at doWrite (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:237:10)
at writeOrBuffer (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:227:5)
at Transform.Writable.write (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:194:11)
at write (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:623:24)
at flow (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:664:5)
at emitNone (events.js:80:13)
at DestroyableTransform.emit (events.js:179:7)
at emitReadable_ (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:448:10)
at emitReadable (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:444:5)
at readableAddChunk (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:187:9)
at DestroyableTransform.Readable.push (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:149:10)
at DestroyableTransform.Transform.push (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:145:32)
at afterTransform (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:101:12)
at TransformState.afterTransform (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:79:12)
at DestroyableTransform.noop [as _transform] (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.2.0.3@through2\through2.js:26:3)
at DestroyableTransform.Transform._read (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:172:12)
at doWrite (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:237:10)
at writeOrBuffer (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (D:\nginx-1.10.2\html\git\fe_asset_platform\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:194:11)
at write (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:623:24)
at flow (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:664:5)
at emitNone (events.js:80:13)
at DestroyableTransform.emit (events.js:179:7)
at emitReadable_ (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:448:10)
at emitReadable (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:444:5)
at readableAddChunk (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:187:9)
at DestroyableTransform.Readable.push (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:149:10)
at DestroyableTransform.Transform.push (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:145:32)
at afterTransform (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:101:12)
at TransformState.afterTransform (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:79:12)
at DestroyableTransform.noop [as _transform] (D:\nginx-1.10.2\html\git\node_modules\.0.6.5@through2\through2.js:26:3)
at DestroyableTransform.Transform._read (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:172:12)
at doWrite (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:237:10)
at writeOrBuffer (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_writable.js:194:11)
at write (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:623:24)
at flow (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:664:5)
at emitNone (events.js:80:13)
at DestroyableTransform.emit (events.js:179:7)
at emitReadable_ (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:448:10)
at emitReadable (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:444:5)
at readableAddChunk (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:187:9)
at DestroyableTransform.Readable.push (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_readable.js:149:10)
at DestroyableTransform.Transform.push (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:145:32)
at afterTransform (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:101:12)
at TransformState.afterTransform (D:\nginx-1.10.2\html\git\node_modules\.1.0.34@readable-stream\lib\_stream_transform.js:79:12)
at D:\nginx-1.10.2\html\git\node_modules\.0.3.14@vinyl-fs\lib\src\getStats.js:15:5
at FSReqWrap.oncomplete (fs.js:82:15)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论