繁体   English   中英

Gulp错误 - 错误:无法找到模块'sigmund'

[英]Gulp error - Error: Cannot find module 'sigmund'

我的Gulp工作正常,直到我安装了浏览器同步

npm install browser-sync gulp --save-dev

然后我开始得到这个错误:

错误:找不到模块'lru-cache'

我用这个解决了: npm link lru-cache来自https://github.com/npm/npm/issues/1154

但是,现在当我尝试运行gulp我得到了这个新错误:

〜/ Projects /starfeeder❯npminstall browser-sync gulp --save-dev npm WARN弃用minimatch@2.0.10:请更新到minimatch 3.0.2或更高版本以避免RegExp DoS问题npm WARN弃用node-uuid@1.4。 8:改用uuid模块

fsevents@1.1.2 install / Users / leongaban / Projects / starfeeder / node_modules / fsevents节点安装

我的gulpfile如果有帮助:

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

我在安装through2遇到了同样的问题。 该项目使用了收缩包装,并有一个package-lock.json ,导致依赖关系中断。 一旦我取下锁并重新安装,一切都很好。

好的,所以仍然不确定为什么我会收到这些错误,但再也不会安装browserSync。

我必须npm link我所有的gulp插件。

这项工作,但随后在gulp build过程中崩溃了。

而不是做npm link到所有东西,包括我从未听说过的其他节点模块。 我删除了browserSync并删除了我的node_modules文件夹并yarn(npm) installyarn(npm) install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM