我试图让项目运行时似乎有一个奇怪的错误,它似乎在mac中工作正常,但我无法在
Windows / ubuntu中运行它
/home/nicholas/Desktop/Workspace/projectx/node_modules/gulp/node_modules/orchestrator/index.js:47 throw new Error('Task '+name+' can\'t support dependencies that is not an a ^ Error: Task connect can't support dependencies that is not an array of strings at Gulp.Orchestrator.add (/home/nicholas/Desktop/Workspace/projectx/node_modules/gulp/node_modules/orchestrator/index.js:47:10) at Object.<anonymous> (/home/nicholas/Desktop/Workspace/projectx/Gulpfile.js:66:6) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:62:18) at Liftoff.launch (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:144:6)
看起来您正在尝试设置一个名为“connect”的任务,并且您将第二个参数设置为除字符串数组或函数之外的其他内容.
即,你有这个:
gulp.task('connect','some-other-task',function() { //... });
但是,它只能是这样的:
gulp.task('connect',['some-other-task'],function() { //... });
差异的原因很可能是在Windows机器上更新了gulp(或者更确切地说是Orchestrator),但在Mac上却没有.如果从两台计算机上的目录中运行npm list,它应该显示当前安装的版本.如果您在Mac上运行npm,则很可能与其他计算机具有相同的错误.