gulp watch报错TypeError: Cannot read property 'watch' of undefined
来源:2-3 命令行处理,创建JS编译任务脚本

Focse
2019-04-06
E:\js\es6\es\es6>gulp --watch
[13:59:45] Requiring external module babel-register
[13:59:46] Using gulpfile E:\js\es6\es\es6\gulpfile.babel.js
[13:59:46] Starting ‘build’…
[13:59:46] Starting ‘clean’…
[13:59:46] Finished ‘clean’ after 8.19 ms
[13:59:46] Starting ‘css’…
[13:59:46] Finished ‘css’ after 8.65 ms
[13:59:46] Starting ‘pages’…
[13:59:46] ‘pages’ errored after 733 μs
[13:59:46] TypeError: Cannot read property ‘watch’ of undefined
at Gulp. (E:/js/es6/es/es6/tasks/pages.js:12:27)
at module.exports (E:\js\es6\es\es6\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (E:\js\es6\es\es6\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (E:\js\es6\es\es6\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (E:\js\es6\es\es6\node_modules\orchestrator\index.js:134:8)
at E:\js\es6\es\es6\node_modules\gulp-sequence\index.js:66:12
at apply (E:\js\es6\es\es6\node_modules\thunks\index.js:354:38)
at tryRun (E:\js\es6\es\es6\node_modules\thunks\index.js:224:19)
at runThunk (E:\js\es6\es\es6\node_modules\thunks\index.js:217:15)
at next (E:\js\es6\es\es6\node_modules\thunks\index.js:321:33)
[13:59:46] ‘build’ errored after 25 ms
[13:59:46] TypeError: Cannot read property ‘watch’ of undefined
at Gulp. (E:/js/es6/es/es6/tasks/pages.js:12:27)
at module.exports (E:\js\es6\es\es6\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (E:\js\es6\es\es6\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (E:\js\es6\es\es6\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (E:\js\es6\es\es6\node_modules\orchestrator\index.js:134:8)
at E:\js\es6\es\es6\node_modules\gulp-sequence\index.js:66:12
at apply (E:\js\es6\es\es6\node_modules\thunks\index.js:354:38)
at tryRun (E:\js\es6\es\es6\node_modules\thunks\index.js:224:19)
at runThunk (E:\js\es6\es\es6\node_modules\thunks\index.js:217:15)
at next (E:\js\es6\es\es6\node_modules\thunks\index.js:321:33)
1回答
-
快乐动起来呀
2019-04-08
同学不要再使用gulp构建哈,课程已经更新了源码使用简单的webpack4,几步就可以,可以跳过构建章节,直接学习语法部分,课程源码:git.imooc.com
022019-06-12
相似问题