5

I've got some issues with trying to run gulp with Ionic.

The error message that pops up is this:

Error: Cannot find module 'gulp-util'

at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/Users/emilymacleod/Desktop/myApp/gulpfile.js:2:13) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

I tried installing sass and gulp locally in the myApp folder as well as globally and no dice.

Thoughts?

  • Could you add the required steps leading to the error message so someone can try to reproduce it? – Heikki Jan 27 '15 at 19:55
  • I'm following this video: https://www.youtube.com/watch?v=C-UwOWB9Io4&feature=youtu.be And I'm at about 15:22 in. I'm trying to use the gulp sass command and it's not working. – emilymacleod86 Jan 27 '15 at 20:09
  • my is now broken too. Tried a lot of uninstalls, installs etc. My error is module.js:338 throw err; ^ Error: Cannot find module 'gulp-util' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/usr/local/lib/node_modules/gulp/bin/gulp.js:4:13) – v3nt Nov 13 '15 at 11:34

3 Answers3

6

Kind of a long shot, but gulp-util is a separated module. You should install it locally:

npm install gulp gulp-util --save-dev

and require it in your code:

var gutil = require('gulp-util');
Caio Cunha
  • 23,326
  • 6
  • 78
  • 74
1

I'm having the problem of cannot find gulp-util even after doing the procedure at the end of this. I can see it's added to the modules and the package.json, but that require statement seems to have an error. It doesn't seem to be working.

The PROCEDURE

npm install gulp gulp-util --save-dev and require it in your code: var gutil = require('gulp-util');

0

I had similar issue with gulp-sass. Error message was:
Uh oh! Looks like you're missing a module in your gulpfile: Cannot find module 'gulp-sass'

Do you need to run npm install?

Resolved by executing the following:

  • npm -g install npm
  • npm install gulp-sass

Hope this help.

Temitope Fatayo
  • 419
  • 4
  • 4