Gulp error - Error: Cannot find module 'sigmund'
My Gulp was working fine until I set browser-sync
npm install browser-sync gulp --save-dev
Then I started getting this error:
Error: Cannot find module 'lru-cache'
What I solved with this: npm link lru-cache
answer from https://github.com/npm/npm/issues/1154
However, now when I try to run gulp
I get this new error:
~ / Projects / starfeeder ❯ npm install browser-sync Gulp --save-dev npm WARN deprecated minimatch@2.0.10 : update to minimum 3.0.2 or higher to avoid RegExp DoS issue npm WARN is deprecated node -uuid@1.4. 8 : use the uuid module instead
fsevents@1.1.2 install / Users / leongaban / Projects / starfeeder / node_modules / fsevents node install
My gulpfile, if it helps:
"use strict";
const gulp = require('gulp'),
_ = require('lodash'), // https://www.npmjs.com/package/lodash
del = require('del'), // https://www.npmjs.com/package/del
fs = require('fs'), // Node file system
gutil = require('gulp-util'), // https://www.npmjs.com/package/gulp-util
htmlReplace = require('gulp-html-replace'), // https://www.npmjs.com/package/gulp-html-replace
notify = require("gulp-notify"), // https://www.npmjs.com/package/gulp-notify
runSequence = require('run-sequence'), // https://www.npmjs.com/package/run-sequence
sass = require('gulp-ruby-sass'), // https://www.npmjs.com/package/gulp-ruby-sass
sourcemaps = require('gulp-sourcemaps'); // https://www.npmjs.com/package/gulp-sourcemaps
const rootPath = process.cwd();
const paths = {
files: ['src/static/**']
};
const errorlog = err => {
gutil.log(gutil.colors.red.bold.inverse(' ERROR: '+err));
this.emit('end');
};
// Build tasks chain ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
gulp.task('build', function(cb) {
runSequence(
'build:app-css', // Minify and concat app styles
'build:move-files',
'build:index', // Replace scripts in index.html
'build:final', cb); // Remove app.min.js from build folder
});
gulp.task('build:move-files', () => gulp.src(paths.files).pipe(gulp.dest('starfeeder/')) );
// Preprocess SASS into CSS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
gulp.task('build:app-css', () => sass('src/sass/starfeeder.scss', { style: 'compressed' }).on('error', errorlog).pipe(gulp.dest('src/static/css/')) );
// Clear out all files and folders from build folder \\\\\\\\\\\\\\\\\\\\\\\\\\\
gulp.task('build:cleanfolder', cb => { del(['starfeeder/**'], cb); });
// Task to make the index file production ready \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
gulp.task('build:index', () => {
process.stdout.write(gutil.colors.white.inverse(' New asset paths in markup: \n'));
process.stdout.write(gutil.colors.yellow(' static/css/starfeeder.css\n'));
gulp.src('index.html')
.pipe(htmlReplace({
'app-css': 'css/starfeeder.css'
}))
.pipe(gulp.dest('starfeeder/'))
.pipe(notify('Starfeeder build created!'));
});
gulp.task('build:final', cb => {
process.stdout.write(gutil.colors.blue.bold ('###################################################### \n'));
process.stdout.write(gutil.colors.blue.inverse(' Starfeeder build created! \n'));
process.stdout.write(gutil.colors.blue.bold ('###################################################### \n'));
});
// Main Styles /////////////////////////////////////////////////////////////////
gulp.task('app-css', () => {
return sass('src/sass/starfeeder.scss', { style: 'compressed' })
.pipe(sourcemaps.init())
.on('error', errorlog)
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('src/static/css/'))
});
// Development watch /////////////////////////////////////////////////////////// 🤖☕️⏎→
gulp.task('watch', () => {
gulp.watch('src/sass/**/*.scss', ['app-css']).on('change', file => {
let filePath = file.path.split(rootPath);
logFileChanged(filePath[1]);
});
});
gulp.task('default', ['watch']);
source to share
Ok so not sure why I got these errors but never installed browserSync again.
I had npm link
all my gulp plugins.
It works, but then it broke during the process gulp build
.
Instead of doing npm link
everything, other node modules are included that I've never heard of. I removed browserSync
and deleted the node_modules folder and done yarn(npm) install
.
source to share