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?
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.
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.
First run npm -g install gulp-cli then run gulp -v. Alternatively, you can just run npm list gulp.
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');
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');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With