Getting: SyntaxError: missing ) after argument list but can't find out whats wrong with hulpfile.js

别来无恙 提交于 2019-12-02 08:14:49

Tried to change that. It directly gives the same error on an other line:

/Users/hmook/Documents/Development/lvdb/gulpfile.js:14
    .pipe(autoprefixer(browsers: ['last 2 versions', '> 5%', 'Firefox ESR']))
                       ^^^^^^^^

SyntaxError: missing ) after argument list
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)

See Gulp Sass with errLogToConsole: true still stopping my other watch tasks and Gulp-generated source maps don't work in Chrome.

Don't use errLogToConsole it doesn't appear to be supported anymore.

.pipe(sass(errLogToConsole: true, outputStyle: 'compressed'))

Change that to

.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))

as in gulp-sass options. Your earlier error was probably due to not including your options in {} braces (it is an object).

[EDIT] :

And your other error is the same

.pipe(autoprefixer(browsers: ['last 2 versions', '> 5%', 'Firefox ESR']))

should be

.pipe(autoprefixer( { browsers: ['last 2 versions', '> 5%', 'Firefox ESR'] } ))

Note the curly braces. Usually the options to gulp plugins are objects so they need to be wrapped in braces {}.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!