Error running gulp, const path = require('path');


I’m just setting Sage up for the first time and I’m getting the below error when I run gulp for the first time;


const path = require(‘path’);
SyntaxError: Use of const in strict mode.
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 Object. (/Volumes/Chef HD/Users/sashaw/Documents/_Websites/sage/BourbonySage/wp-content/themes/sage/gulpfile.js:10:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions…js (module.js:478:10)

Setup Mac OSX El Captain
Node: v0.12.5
NPM: 2.11.2

Can anyone help?

Thanks, Stephen


That’s happened to me today. I think that the problem is the version of node.

What I did is:

  • Delete the node_modules folder,
  • Update node to the last version
  • Install npm again
  • run gulp

Hope that help


Hi aswebmedia,

Yes, that worked. I also installed node via NVM which was recommended.

Cheers, Stephen