csstools / postcss-short

Use advanced shorthand properties in CSS
https://jonathantneal.github.io/postcss-short
Creative Commons Zero v1.0 Universal
189 stars 7 forks source link

Syntax error... what version of node is required? #10

Closed drywall closed 7 years ago

drywall commented 7 years ago

Just bumped from 1.4.0 to 3.0.3, and am now getting this error when trying to run postcss-short via gulpfile:

ben@dev2 ~/sites/wordpress/cms/assets/themes/crate (master *=) $ gulp
/home/ben/sites/wordpress/cms/assets/themes/crate/node_modules/postcss-short/index.js:17
module.exports = postcss.plugin('postcss-short', (opts = {}) => {
                                                       ^

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.<anonymous> (/home/ben/sites/wordpress/cms/assets/themes/crate/gulpfile.js:124:2)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

This error is severe enough that I assume it's something wrong on my end and not a true bug in postcss-short, but I'm wondering if there's an easy/obvious resolution?

jonathantneal commented 7 years ago

Hi @drywall, as your title suggests, the issue may lie with the version of Node that you are using.

https://github.com/jonathantneal/postcss-short/blob/master/package.json#L21-L23

Based on your error report and kangax data, you would need Node v6.5+. The current LTS should work just fine, which is listed as v6.9.3 at the time of this response.

drywall commented 7 years ago

Yep, that fixed it. Thanks for incredibly rapid response.