麻烦老师看下我gulp配置的问题

来源:3-4 自动化构建工具(3)

liuchenyang

2018-10-21

麻烦老师看下我gulp配置的问题

gulp.task(‘serve’, function(){
$.connect.server({
root:[app.devPath],
livereload:true,
port:1234
});
open(‘http://localhost:1234’);
});
每次运行serve命令的时候总是报错 内容是:
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions…js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\Administrator\Desktop\MyBlog\node_modules\gulp-connect\index.js:8:10)
at Module._compile (module.js:409:26)
at Object.Module._extensions…js (module.js:416:10)

请问老师这个命令为什么会报错呢
写回答

3回答

慕雪1613582

2018-10-22

应该是你写的js配置文件有问题,比如括号没有闭合之类的。使用校验工具检查一下~

0
0

liuchenyang

提问者

2018-10-21

我确认了一下我也安装好了gulp-connect包


0
0

liuchenyang

提问者

2018-10-21

我直接下载了您的课件 然后复制了gulp配置 但是还是报一样的错。 如果不加   .pipe($.connect.reload()); 就可以执行这些命令 加上以后就报以上错误 应该是connect某个地方出了问题 麻烦老师帮忙看下


0
0

Angular JS 仿拉勾网 WebApp 开发移动端单页应用

基于AngularJS,仿拉勾网开发一个招聘类的移动端单页应用

1660 学习 · 857 问题

查看课程