Godfy
Godfy

Reputation: 15

SyntaxError: Unexpected token =>

When I ran the gulp command from the root of the project, a problem turned out.

elixir((mix) => {

SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at execute (D:\nodejs\node_global\node_modules\gulp-cli\lib\versioned\^3.7.0\index.js:24:18)
at Liftoff.handleArguments (D:\nodejs\node_global\node_modules\gulp-cli\index.js:149:63)
at Liftoff.<anonymous> (D:\nodejs\node_global\node_modules\gulp-cli\node_modules\liftoff\index.js:198:16)

The gulpfile is from a Laravel Project, here it is https://github.com/rappasoft/laravel-5-boilerplate/blob/master/gulpfile.js . I had searched the problem above over stack and other network station, but couldn't find any useful advise. Btw, it was run on Windows, you can get it from the details code above. If somebody can help, I will be very appreciate . THX !

Upvotes: 0

Views: 891

Answers (1)

Orkhan Farmanli
Orkhan Farmanli

Reputation: 174

Arrow function are new JavaScript (ES6), so maybe your node and npm version is old and you should upgrade it. Use this official installer.

https://nodejs.org/dist/v6.9.2/node-v6.9.2-x64.msi

Upvotes: 1

Related Questions