Gulp, Cannot read property 'apply' of undefined
gulp -v
CLI version 3.9.1
Local version 4.0.0
这里的CLI版本是什么意思?不懂?
但是npm上发布的gulp-cli的版本最新是2.0.0,执行gulp命令后才会出现下面的错误
在gulp的github的issue里找到解决方案是全局安装下gulp-cli:
npm i gulp-cli -g
错误消失
$ gulp generic
[10:45:13] Using gulpfile ~\Desktop\pdf.js-master\gulpfile.js
D:\nodejs\node_global\node_modules\gulp\bin\gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^
TypeError: Cannot read property 'apply' of undefined
at D:\nodejs\node_global\node_modules\gulp\bin\gulp.js:129:19
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:607:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3