highlight.js icon indicating copy to clipboard operation
highlight.js copied to clipboard

tasks.js has syntax error

Open thoughtjigs opened this issue 11 years ago • 5 comments

There is a syntax error in tasks.js that prevents building with gulp ...

return del(directories).then(() => done(null, blobs));

node_modules/highlight.js/tools/tasks.js:15 return del(directories).then(() => done(null, blobs)); ^ SyntaxError: Unexpected token ) at Module._compile (module.js:439:25) 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 Object. (rtail/node_modules/highlight.js/tools/build.js:65:17) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)

/home/tpci/rtail/gulpfile.js:86 if (0 !== code) throw new Error('node tools/build.js exited with ' + cod ^ Error: node tools/build.js exited with 8 at ChildProcess. (rtail/gulpfile.js:86:29) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:766:16) at Process.ChildProcess._handle.onexit (child_process.js:833:5)

thoughtjigs avatar Nov 11 '15 00:11 thoughtjigs

If I rewrite the line as: return del(directories).then(done(null, blobs)); it compiles without error

thoughtjigs avatar Nov 11 '15 00:11 thoughtjigs

We recently switched our toolchain to node 4.x, which version are you using?

isagalaev avatar Nov 11 '15 01:11 isagalaev

ubuntu-trusty:~$ node --version v0.10.37

thoughtjigs avatar Nov 11 '15 01:11 thoughtjigs

This is probably the reason of it misbehaving. You might want to upgrade node.js to a contemporary release from a supported repository: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

isagalaev avatar Nov 11 '15 04:11 isagalaev

Closing this since it isn't really a syntax error, at least for the new versions of node, but rather the build script using an ES6 feature called arrow functions.

sourrust avatar Nov 18 '15 23:11 sourrust