Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues with ionic: Error: Cannot find module 'gulp-util'

Tags:

gulp

ionic

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?

like image 406
emilymacleod86 Avatar asked Jan 27 '15 17:01

emilymacleod86


People also ask

Can not find module gulp?

Install the gulp-sass module manually If you don't see the gulp-sass package in your node_modules folder, or are still having issues, you can try reinstalling the package. First, open your package. json and package-lock. json files and remove any references to gulp-sass and node-sass that you see.

How do I fix no Gulpfile?

var gulp = require('gulp');gulp. task('default', function() { //Here is the code for the default task}); Then you run the gulp serve command and you will not get the no gulpfile found error in your SPFx project.

How do I know if gulp command line is installed?

First run npm -g install gulp-cli then run gulp -v. Alternatively, you can just run npm list gulp.


2 Answers

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');
like image 162
Caio Cunha Avatar answered Dec 04 '22 10:12

Caio Cunha


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');

like image 26
Timothy Carey Avatar answered Dec 04 '22 08:12

Timothy Carey