Roots Discourse

Sage 8.6.0 - Gulp Error


I’m getting an error when running Gulp and compiling my assets using Sage 8.6.0:

let isMatch = picomatch(String(patterns[i]), { …options, onResult }, true);
SyntaxError: Unexpected token …

Anybody come across this error before?

My Gulp build process has been working fine up until now :frowning:

Many thanks,

Maybe an incompatibility with a older/newer node version?
Ensure a node version that is known to build correctly is used, by using a node version manager like [nvm](
Requirements for Sage 8.6 (last 8. release):

Node.js >= 6.9, so try building the theme starting with node version 6.9:

$ nvm install 6.9
$ nvm use 6.9

$ gulp
# or
$ gulp --production

When you found a working node version, you may want to add a .nvmrc file to the project with that version to document it and automatically lock that version in when entering the directory, it also helps when deploying with Trellis as it the deploy script can be easily modified to invoke node/npm with nvm and ensure the proper node version is used during the build.

1 Like

I’m using and have been using node 6.9.5 for sometime now.

It’s been working fine up until now :frowning:

Are you sure that you are indeed using node v6.9 for building?
node -v in the theme directory…

Remove the whole node_modules and npm install again.
Be wary of npm audit because it could update packages in a breaking way.
Also ensure the package lock file is checked out and is known to build.

Related issues concerning the node version used (maybe try a newer node version?):

Didn’t see this thread, sorry: