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

**URL:** https://discourse.roots.io/t/error-running-gulp-const-path-require-path/8122
**Category:** sage
**Created:** 2016-11-17T15:42:22Z
**Posts:** 3

## Post 1 by @anartfulscience — 2016-11-17T15:42:22Z

Hello,

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;

/themes/sage/node\_modules/gulp-imagemin/index.js:2

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

---

## Post 2 by @aswebmedia — 2016-11-17T16:26:49Z

Hi,

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

Cheers

---

## Post 3 by @anartfulscience — 2016-11-17T17:52:08Z

Hi aswebmedia,

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

Cheers, Stephen
