uswds / uswds-gulp

A simple Gulp 4.0 workflow for transforming USWDS Sass into browser-readable CSS.
Other
35 stars 17 forks source link

`gulp init` gives SyntaxError #5

Closed quentint closed 2 years ago

quentint commented 5 years ago

Here's the error I get when I follow the installation steps and get to the gulp init one:

C:\Users\Quentin\Desktop\usa\gulpfile.js:121
));
^
SyntaxError: Unexpected token )
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at execute (C:\Users\Quentin\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js:36:18)

I tried removing the extra comma, but then I get this:

C:\Users\Quentin\Desktop\usa\node_modules\css-mqpacker\index.js:139
    ...options
    ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Quentin\Desktop\usa\gulpfile.js:18:21)

FYI, here's what gulp -v gives:

CLI version 2.1.0
Local version 4.0.0

I must be doing something wrong, but can't figure out what.

thisisdano commented 5 years ago

I'll look into this.

thisisdano commented 5 years ago

I'm not yet able to reproduce this, but I will check the syntax in the gulpfile. I am using the same CLI and local version

quentint commented 5 years ago

It looks like the syntax errors should not exist if the script was correctly interpreted as ES6. Apparently it is not.

Am I right?

thisisdano commented 5 years ago

I removed the trailing comma just as you did to conform to ES6, and I also can't reproduce the subsequent error which seems to be related to mqpacker — that said, my test environment has no Sass in it. I'll fix that.

thisisdano commented 5 years ago

Hm — looks like that package has been deprecated: https://www.npmjs.com/package/css-mqpacker

quentint commented 5 years ago

Ah. And this issue doesn't help: https://github.com/hail2u/node-css-mqpacker/issues/72

kdimatteo commented 5 years ago

works as expected in :

CLI version: 2.2.0
Local version: 4.0.2
arkjoseph commented 5 years ago

how can i resolve ? im also receiving same error

mejiaj commented 4 years ago

@arkjoseph, is this on a fresh install or an older instance?

What does package.json look like?

What about gulp -v && node -v in terminal?

thisisdano commented 2 years ago

Closing stale issue